refs #892: Cocoa support for map ID style URLs
This commit is contained in:
@@ -33,6 +33,13 @@
|
||||
* @return An initialized map view, or `nil` if the map view was unable to be initialized. */
|
||||
- (instancetype)initWithFrame:(CGRect)frame accessToken:(NSString *)accessToken bundledStyleNamed:(NSString *)styleName;
|
||||
|
||||
/** Initialize a map view with a given frame, style URL, and access token.
|
||||
* @param frame The frame with which to initialize the map view.
|
||||
* @param accessToken A Mapbox API access token.
|
||||
* @param styleURL The map style URL to use. Can be either an HTTP/HTTPS URL or a Mapbox map ID style URL (`mapbox://<user.style>`).
|
||||
* @return An initialized map view, or `nil` if the map view was unable to be initialized. */
|
||||
- (instancetype)initWithFrame:(CGRect)frame accessToken:(NSString *)accessToken styleURL:(NSURL *)styleURL;
|
||||
|
||||
/** Initialize a map view with a given frame, the default style, and an access token.
|
||||
* @param frame The frame with which to initialize the map view.
|
||||
* @param accessToken A Mapbox API access token.
|
||||
|
||||
@@ -132,6 +132,19 @@ mbgl::DefaultFileSource *mbglFileSource = nullptr;
|
||||
return self;
|
||||
}
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame accessToken:(NSString *)accessToken styleURL:(NSURL *)styleURL
|
||||
{
|
||||
self = [super initWithFrame:frame];
|
||||
|
||||
if (self && [self commonInit])
|
||||
{
|
||||
if (accessToken) [self setAccessToken:accessToken];
|
||||
if (styleURL) [self setStyleURL:[styleURL absoluteString]];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame accessToken:(NSString *)accessToken
|
||||
{
|
||||
return [self initWithFrame:frame accessToken:accessToken styleJSON:nil];
|
||||
|
||||
Reference in New Issue
Block a user