allow setting nil mapID for default style
This commit is contained in:
committed by
Minh Nguyễn
parent
2916ae2735
commit
6eb79338f3
@@ -176,7 +176,9 @@ IB_DESIGNABLE
|
||||
|
||||
/** 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://<user.style>`). To display the default style, set this property to `nil`. */
|
||||
* The URL may be a full HTTP or HTTPS URL or a Mapbox URL indicating the style’s map ID (`mapbox://<user.style>`).
|
||||
*
|
||||
* To display the default style, set this property to `nil`. */
|
||||
@property (nonatomic) NSURL *styleURL;
|
||||
|
||||
#pragma mark - Annotating the Map
|
||||
|
||||
@@ -1332,7 +1332,14 @@ CLLocationCoordinate2D latLngToCoordinate(mbgl::LatLng latLng)
|
||||
|
||||
- (void)setMapID:(NSString *)mapID
|
||||
{
|
||||
self.styleURL = [NSURL URLWithString:[NSString stringWithFormat:@"mapbox://%@", mapID]];
|
||||
if (mapID)
|
||||
{
|
||||
self.styleURL = [NSURL URLWithString:[NSString stringWithFormat:@"mapbox://%@", mapID]];
|
||||
}
|
||||
else
|
||||
{
|
||||
self.styleURL = nil;
|
||||
}
|
||||
}
|
||||
|
||||
- (NSArray *)getAppliedStyleClasses
|
||||
|
||||
Reference in New Issue
Block a user