diff options
author | Justin R. Miller <incanus@codesorcery.net> | 2015-04-02 16:15:36 -0700 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2015-04-03 12:41:37 -0700 |
commit | 6eb79338f3298de8f0137125783f505f3cb9b407 (patch) | |
tree | 13e792d7f063cb9320d4828831b832636fff5258 | |
parent | 2916ae2735bd46cdd87f32c0ab3efb5651ea8998 (diff) | |
download | qtlocation-mapboxgl-6eb79338f3298de8f0137125783f505f3cb9b407.tar.gz |
allow setting nil mapID for default style
-rw-r--r-- | include/mbgl/ios/MGLMapView.h | 4 | ||||
-rw-r--r-- | platform/ios/MGLMapView.mm | 9 |
2 files changed, 11 insertions, 2 deletions
diff --git a/include/mbgl/ios/MGLMapView.h b/include/mbgl/ios/MGLMapView.h index 3ee1b4e9d0..5db1f425d5 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://<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 diff --git a/platform/ios/MGLMapView.mm b/platform/ios/MGLMapView.mm index 63ed8e11a8..18937b94fb 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 |