Made lat/lon/zoom inspectable
Declared these IB-specific inspectables in a separate category that developers are not expected to import. Currently these inspectables are order-dependent due to #1181. Ref #929
This commit is contained in:
29
include/mbgl/ios/MGLMapView+IBAdditions.h
Normal file
29
include/mbgl/ios/MGLMapView+IBAdditions.h
Normal file
@@ -0,0 +1,29 @@
|
||||
#import "MGLMapView.h"
|
||||
|
||||
@interface MGLMapView (IBAdditions)
|
||||
|
||||
// Core properties that can be manipulated in the Attributes inspector in
|
||||
// Interface Builder. These redeclarations merely add the IBInspectable keyword.
|
||||
// They appear here to ensure that they appear above the convenience properties;
|
||||
// inspectables declared in MGLMapView.h are always sorted before those in
|
||||
// MGLMapView+IBAdditions.h, due to ASCII sort order.
|
||||
|
||||
@property (nonatomic) IBInspectable NSString *accessToken;
|
||||
@property (nonatomic) IBInspectable NSString *mapID;
|
||||
|
||||
// Some convenience properties related to the initial viewport. These properties
|
||||
// are not meant to be used outside of Interface Builder. latitude and longitude
|
||||
// are backed by properties of type CLLocationDegrees, but these declarations
|
||||
// must use the type double because Interface Builder is unaware that
|
||||
// CLLocationDegrees is a typedef for double.
|
||||
|
||||
/// Initial latitude at which the receiver is centered.
|
||||
@property (nonatomic) IBInspectable double latitude;
|
||||
|
||||
/// Initial longitude at which the receiver is centered.
|
||||
@property (nonatomic) IBInspectable double longitude;
|
||||
|
||||
/// Initial zoom level of the receiver.
|
||||
@property (nonatomic) IBInspectable double zoomLevel;
|
||||
|
||||
@end
|
||||
@@ -39,9 +39,8 @@ IB_DESIGNABLE
|
||||
|
||||
/** @name Authorizing Access */
|
||||
|
||||
/** Sets a Mapbox API access token for the map view.
|
||||
* @param accessToken A Mapbox API token. */
|
||||
@property (nonatomic) IBInspectable NSString *accessToken;
|
||||
/** Mapbox API access token for the map view. */
|
||||
@property (nonatomic) NSString *accessToken;
|
||||
|
||||
#pragma mark - Managing Constraints
|
||||
|
||||
@@ -166,10 +165,11 @@ IB_DESIGNABLE
|
||||
/** @name Styling the Map */
|
||||
|
||||
/** 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;
|
||||
*
|
||||
* The style may lack a map ID if it is located at an HTTP, HTTPS, or local file URL. Use `styleURL` to get the URL in these cases.
|
||||
*
|
||||
* To display the default style, set this property to `nil`. */
|
||||
@property (nonatomic) NSString *mapID;
|
||||
|
||||
/** Returns the URLs to the styles bundled with the library. */
|
||||
- (NSArray *)bundledStyleURLs;
|
||||
|
||||
Reference in New Issue
Block a user