diff options
Diffstat (limited to 'platform/osx')
-rw-r--r-- | platform/osx/include/MGLAccountManager.h | 44 | ||||
-rw-r--r-- | platform/osx/sdk/Mapbox.h | 4 | ||||
-rw-r--r-- | platform/osx/sdk/Mapbox.m | 3 | ||||
-rw-r--r-- | platform/osx/src/MGLAccountManager.m | 54 | ||||
-rw-r--r-- | platform/osx/src/MGLAccountManager_Private.h | 15 | ||||
-rw-r--r-- | platform/osx/src/MGLAnnotationImage.m | 2 | ||||
-rw-r--r-- | platform/osx/src/MGLMapView+IBAdditions.m | 2 | ||||
-rw-r--r-- | platform/osx/src/MGLMapView.mm | 16 | ||||
-rw-r--r-- | platform/osx/src/MGLMapView_Private.h | 2 | ||||
-rw-r--r-- | platform/osx/src/NSBundle+MGLAdditions.h | 16 | ||||
-rw-r--r-- | platform/osx/src/NSBundle+MGLAdditions.m | 13 | ||||
-rw-r--r-- | platform/osx/src/NSProcessInfo+MGLAdditions.h | 11 | ||||
-rw-r--r-- | platform/osx/src/NSProcessInfo+MGLAdditions.m | 11 |
13 files changed, 18 insertions, 175 deletions
diff --git a/platform/osx/include/MGLAccountManager.h b/platform/osx/include/MGLAccountManager.h deleted file mode 100644 index efcec5419c..0000000000 --- a/platform/osx/include/MGLAccountManager.h +++ /dev/null @@ -1,44 +0,0 @@ -#import <Foundation/Foundation.h> - -#import "MGLTypes.h" - -NS_ASSUME_NONNULL_BEGIN - -/** The MGLAccountManager object provides a global way to set a Mapbox API - access token, as well as other settings used framework-wide. */ -@interface MGLAccountManager : NSObject - -#pragma mark Authorizing access -/** @name Authorizing Access */ - -/** Set the - [Mapbox access token](https://www.mapbox.com/help/define-access-token/) to - used by all instances of MGLMapView in the current application. - - Mapbox-hosted vector tiles and styles require an API access token, which you - can obtain from the - [Mapbox account page](https://www.mapbox.com/studio/account/tokens/). Access - tokens associate requests to Mapbox’s vector tile and style APIs with your - Mapbox account. They also deter other developers from using your styles - without your permission. - - @param accessToken A Mapbox access token. Calling this method with a value - of `nil` has no effect. - - @note You must set the access token before attempting to load any - Mapbox-hosted style. Therefore, you should generally set it before - creating an instance of MGLMapView. The recommended way to set an access - token is to add an entry to your application’s Info.plist file with the - key `MGLMapboxAccessToken` and the type String. Alternatively, you may - call this method from your application delegate’s - -applicationDidFinishLaunching: method. */ -+ (void)setAccessToken:(nullable NSString *)accessToken; - -/** Returns the - [Mapbox access token](https://www.mapbox.com/help/define-access-token/) in - use by instances of MGLMapView in the current application. */ -+ (nullable NSString *)accessToken; - -@end - -NS_ASSUME_NONNULL_END diff --git a/platform/osx/sdk/Mapbox.h b/platform/osx/sdk/Mapbox.h index ca09fbd641..018d16b3c0 100644 --- a/platform/osx/sdk/Mapbox.h +++ b/platform/osx/sdk/Mapbox.h @@ -9,6 +9,9 @@ FOUNDATION_EXPORT const unsigned char MapboxVersionString[]; #import <Mapbox/MGLAccountManager.h> #import <Mapbox/MGLAnnotation.h> #import <Mapbox/MGLAnnotationImage.h> +#import <Mapbox/MGLDownloadable.h> +#import <Mapbox/MGLDownloadRegion.h> +#import <Mapbox/MGLDownloadController.h> #import <Mapbox/MGLGeometry.h> #import <Mapbox/MGLMapCamera.h> #import <Mapbox/MGLMapView.h> @@ -21,4 +24,5 @@ FOUNDATION_EXPORT const unsigned char MapboxVersionString[]; #import <Mapbox/MGLPolyline.h> #import <Mapbox/MGLShape.h> #import <Mapbox/MGLStyle.h> +#import <Mapbox/MGLTilePyramidDownloadRegion.h> #import <Mapbox/MGLTypes.h> diff --git a/platform/osx/sdk/Mapbox.m b/platform/osx/sdk/Mapbox.m index 58ebb408e0..5246124088 100644 --- a/platform/osx/sdk/Mapbox.m +++ b/platform/osx/sdk/Mapbox.m @@ -19,6 +19,8 @@ static void InitializeMapbox() { [MGLAccountManager class]; [MGLAnnotationImage class]; + [MGLDownloadable class]; + [MGLDownloadController class]; [MGLMapCamera class]; [MGLMapView class]; [MGLMultiPoint class]; @@ -27,4 +29,5 @@ static void InitializeMapbox() { [MGLPolyline class]; [MGLShape class]; [MGLStyle class]; + [MGLTilePyramidDownloadRegion class]; } diff --git a/platform/osx/src/MGLAccountManager.m b/platform/osx/src/MGLAccountManager.m deleted file mode 100644 index 8458248357..0000000000 --- a/platform/osx/src/MGLAccountManager.m +++ /dev/null @@ -1,54 +0,0 @@ -#import "MGLAccountManager_Private.h" - -#import <MGLMapView.h> - -@interface MGLAccountManager () - -@property (atomic) NSString *accessToken; - -@end - -@implementation MGLAccountManager - -#pragma mark - Internal - -+ (void)load { - // Read the initial configuration from Info.plist. - NSString *accessToken = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"MGLMapboxAccessToken"]; - if (accessToken.length) { - self.accessToken = accessToken; - } -} - -+ (instancetype)sharedManager { - static dispatch_once_t onceToken; - static MGLAccountManager *_sharedManager; - void (^setupBlock)() = ^{ - dispatch_once(&onceToken, ^{ - _sharedManager = [[self alloc] init]; - }); - }; - if (![[NSThread currentThread] isMainThread]) { - dispatch_sync(dispatch_get_main_queue(), ^{ - setupBlock(); - }); - } - else { - setupBlock(); - } - return _sharedManager; -} - -+ (void)setAccessToken:(NSString *)accessToken { - accessToken = [accessToken stringByTrimmingCharactersInSet: - [NSCharacterSet whitespaceAndNewlineCharacterSet]]; - if (![accessToken length]) return; - - [MGLAccountManager sharedManager].accessToken = accessToken; -} - -+ (NSString *)accessToken { - return [MGLAccountManager sharedManager].accessToken; -} - -@end diff --git a/platform/osx/src/MGLAccountManager_Private.h b/platform/osx/src/MGLAccountManager_Private.h deleted file mode 100644 index 5088c8dfd2..0000000000 --- a/platform/osx/src/MGLAccountManager_Private.h +++ /dev/null @@ -1,15 +0,0 @@ -#import <MGLAccountManager.h> - -@interface MGLAccountManager (Private) - -/** - Returns the shared instance of the `MGLAccountManager` class. - - This method can be called from any thread. - */ -+ (instancetype)sharedManager; - -/// The current global access token. -@property (atomic) NSString *accessToken; - -@end diff --git a/platform/osx/src/MGLAnnotationImage.m b/platform/osx/src/MGLAnnotationImage.m index e65a6d15cf..49346b073b 100644 --- a/platform/osx/src/MGLAnnotationImage.m +++ b/platform/osx/src/MGLAnnotationImage.m @@ -1,4 +1,4 @@ -#import <MGLAnnotationImage.h> +#import "MGLAnnotationImage.h" @interface MGLAnnotationImage () diff --git a/platform/osx/src/MGLMapView+IBAdditions.m b/platform/osx/src/MGLMapView+IBAdditions.m index cafd4511f1..da18760645 100644 --- a/platform/osx/src/MGLMapView+IBAdditions.m +++ b/platform/osx/src/MGLMapView+IBAdditions.m @@ -1,4 +1,4 @@ -#import <MGLMapView+IBAdditions.h> +#import "MGLMapView+IBAdditions.h" #import "MGLMapView_Private.h" diff --git a/platform/osx/src/MGLMapView.mm b/platform/osx/src/MGLMapView.mm index 67729c2607..07c080663f 100644 --- a/platform/osx/src/MGLMapView.mm +++ b/platform/osx/src/MGLMapView.mm @@ -1,18 +1,18 @@ #import "MGLMapView_Private.h" -#import "MGLAccountManager_Private.h" #import "MGLAttributionButton.h" #import "MGLCompassCell.h" #import "MGLOpenGLLayer.h" #import "MGLStyle.h" +#import "../../darwin/src/MGLAccountManager_Private.h" #import "../../darwin/src/MGLGeometry_Private.h" #import "../../darwin/src/MGLMultiPoint_Private.h" -#import <MGLMapCamera.h> -#import <MGLPolygon.h> -#import <MGLPolyline.h> -#import <MGLAnnotationImage.h> -#import <MGLMapViewDelegate.h> +#import "MGLMapCamera.h" +#import "MGLPolygon.h" +#import "MGLPolyline.h" +#import "MGLAnnotationImage.h" +#import "MGLMapViewDelegate.h" #import <mbgl/mbgl.hpp> #import <mbgl/annotation/point_annotation.hpp> @@ -30,8 +30,8 @@ #import <map> #import <unordered_set> -#import "NSBundle+MGLAdditions.h" -#import "NSProcessInfo+MGLAdditions.h" +#import "../../darwin/src/NSBundle+MGLAdditions.h" +#import "../../darwin/src/NSProcessInfo+MGLAdditions.h" #import "../../darwin/src/NSException+MGLAdditions.h" #import "../../darwin/src/NSString+MGLAdditions.h" diff --git a/platform/osx/src/MGLMapView_Private.h b/platform/osx/src/MGLMapView_Private.h index a162beca61..b9a112718e 100644 --- a/platform/osx/src/MGLMapView_Private.h +++ b/platform/osx/src/MGLMapView_Private.h @@ -1,4 +1,4 @@ -#import <MGLMapView.h> +#import "MGLMapView.h" void mgl_linkMapViewIBCategory(); diff --git a/platform/osx/src/NSBundle+MGLAdditions.h b/platform/osx/src/NSBundle+MGLAdditions.h deleted file mode 100644 index 642fcf141b..0000000000 --- a/platform/osx/src/NSBundle+MGLAdditions.h +++ /dev/null @@ -1,16 +0,0 @@ -#import <Foundation/Foundation.h> - -#import "MGLTypes.h" - -NS_ASSUME_NONNULL_BEGIN - -void mgl_linkBundleCategory(); - -@interface NSBundle (MGLAdditions) - -/// Returns the Mapbox.framework bundle. -+ (instancetype)mgl_frameworkBundle; - -@end - -NS_ASSUME_NONNULL_END diff --git a/platform/osx/src/NSBundle+MGLAdditions.m b/platform/osx/src/NSBundle+MGLAdditions.m deleted file mode 100644 index 658d515ebf..0000000000 --- a/platform/osx/src/NSBundle+MGLAdditions.m +++ /dev/null @@ -1,13 +0,0 @@ -#import "NSBundle+MGLAdditions.h" - -#import "MGLAccountManager.h" - -void mgl_linkBundleCategory() {} - -@implementation NSBundle (MGLAdditions) - -+ (instancetype)mgl_frameworkBundle { - return [self bundleForClass:[MGLAccountManager class]]; -} - -@end diff --git a/platform/osx/src/NSProcessInfo+MGLAdditions.h b/platform/osx/src/NSProcessInfo+MGLAdditions.h deleted file mode 100644 index cd5ec148ec..0000000000 --- a/platform/osx/src/NSProcessInfo+MGLAdditions.h +++ /dev/null @@ -1,11 +0,0 @@ -#import <Foundation/Foundation.h> - -void mgl_linkProcessInfoCategory(); - -@interface NSProcessInfo (MGLAdditions) - -/// Returns YES if the current process is Interface Builder’s helper process for -/// rendering designables. -- (BOOL)mgl_isInterfaceBuilderDesignablesAgent; - -@end diff --git a/platform/osx/src/NSProcessInfo+MGLAdditions.m b/platform/osx/src/NSProcessInfo+MGLAdditions.m deleted file mode 100644 index 16f869703c..0000000000 --- a/platform/osx/src/NSProcessInfo+MGLAdditions.m +++ /dev/null @@ -1,11 +0,0 @@ -#import "NSProcessInfo+MGLAdditions.h" - -void mgl_linkProcessInfoCategory() {} - -@implementation NSProcessInfo (MGLAdditions) - -- (BOOL)mgl_isInterfaceBuilderDesignablesAgent { - return [self.processName isEqualToString:@"IBDesignablesAgent"]; -} - -@end |