From e18e4b0de5f601cdfb07eed209e64f88a114e492 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguy=E1=BB=85n?= Date: Tue, 31 Mar 2015 15:48:01 -0700 Subject: Removed redundant initializers and setters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change removes most of the ways you used to be able to apply a style to the map. Building on #1163, `styleURL` (HTTP(S), mapbox:, asset:) is the canonical way to apply a style, and `mapID` is a convenient shorthand for Mapbox-hosted styles. A relative style URL is interpreted as a path relative to the app’s main bundle. We now construct asset: URLs in lieu of “bundled style names”. --- include/mbgl/ios/MGLMapView.h | 43 +++++++++++-------------------------------- 1 file changed, 11 insertions(+), 32 deletions(-) (limited to 'include') diff --git a/include/mbgl/ios/MGLMapView.h b/include/mbgl/ios/MGLMapView.h index 354e32cc5a..dcf1313a8c 100644 --- a/include/mbgl/ios/MGLMapView.h +++ b/include/mbgl/ios/MGLMapView.h @@ -19,20 +19,6 @@ /** @name Initializing a Map View */ -/** Initialize a map view with a given frame, style, and access token. -* @param frame The frame with which to initialize the map view. -* @param accessToken A Mapbox API access token. -* @param styleJSON The map stylesheet as JSON text. -* @return An initialized map view, or `nil` if the map view was unable to be initialized. */ -- (instancetype)initWithFrame:(CGRect)frame accessToken:(NSString *)accessToken styleJSON:(NSString *)styleJSON; - -/** Initialize a map view with a given frame, bundled style name, and access token. -* @param frame The frame with which to initialize the map view. -* @param accessToken A Mapbox API access token. -* @param styleName The map style name to use. -* @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. @@ -178,26 +164,19 @@ /** @name Styling the Map */ -/** Sets the map style. -* @param styleJSON The map stylesheet as JSON text. */ -- (void)setStyleJSON:(NSString *)styleJSON; - -/** Returns the raw JSON style as a native dictionary object. */ -- (NSDictionary *)getRawStyle; - -/** Sets the raw JSON style as a native dictionary object with a transition animation. -* @param style The style JSON as a dictionary object. */ -- (void)setRawStyle:(NSDictionary *)style; - -/** Returns the names of the styles bundled with the library. */ -- (NSArray *)bundledStyleNames; +/** Mapbox map ID of the style currently displayed in the receiver, or `nil` if the style does not have a map ID. + + The style may lack a map ID if it is located at an HTTP, HTTPS, or asset: URL. Use -styleURL to get the URL in these cases. + */ +@property (nonatomic) IBInspectable NSString *mapID; -/** Sets the map style to a named, bundled style. -* @param styleName The map style name to use. */ -@property (nonatomic) IBInspectable NSString *styleName; +/** Returns the URLs to the styles bundled with the library. */ +- (NSArray *)bundledStyleURLs; -/** Sets the map style URL to use. -* @param styleURL The map style URL to use. Can be either an HTTP/HTTPS URL or a Mapbox map ID style URL (`mapbox://`). */ +/** URL of the style currently displayed in the receiver. + + The URL may be a full HTTP or HTTPS URL or a Mapbox URL indicating the style’s map ID (`mapbox://`). To display the default style, set this property to `nil`. + */ @property (nonatomic) NSURL *styleURL; #pragma mark - Annotating the Map -- cgit v1.2.1