[macos] Warn if access token needed but not given
When setting a nil style URL or any mapbox: style URL, if no access token has been provided, log a warning instead of asserting.
This commit is contained in:
committed by
Minh Nguyễn
parent
a19ce69455
commit
e10360f34a
@@ -610,13 +610,14 @@ public:
|
||||
|
||||
// Default to Streets.
|
||||
if (!styleURL) {
|
||||
// An access token is required to load any default style, including
|
||||
// Streets.
|
||||
if (![MGLAccountManager accessToken]) {
|
||||
return;
|
||||
}
|
||||
styleURL = [MGLStyle streetsStyleURLWithVersion:MGLStyleDefaultVersion];
|
||||
}
|
||||
|
||||
// An access token is required to load any default style, including Streets.
|
||||
if (![MGLAccountManager accessToken] && [styleURL.scheme isEqualToString:@"mapbox"]) {
|
||||
NSLog(@"Cannot set the style URL to %@ because no access token has been specified.", styleURL);
|
||||
return;
|
||||
}
|
||||
|
||||
styleURL = styleURL.mgl_URLByStandardizingScheme;
|
||||
self.style = nil;
|
||||
|
||||
Reference in New Issue
Block a user