diff --git a/include/mbgl/ios/MGLMapView.h b/include/mbgl/ios/MGLMapView.h index 3ee1b4e9d..5db1f425d 100644 --- a/include/mbgl/ios/MGLMapView.h +++ b/include/mbgl/ios/MGLMapView.h @@ -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://`). 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://`). +* +* To display the default style, set this property to `nil`. */ @property (nonatomic) NSURL *styleURL; #pragma mark - Annotating the Map diff --git a/platform/ios/MGLMapView.mm b/platform/ios/MGLMapView.mm index 63ed8e11a..18937b94f 100644 --- a/platform/ios/MGLMapView.mm +++ b/platform/ios/MGLMapView.mm @@ -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