diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2015-05-13 16:33:40 -0700 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2015-05-13 16:33:40 -0700 |
commit | 164ff72297a0b57c42cc5dc1299e6b7f1dd13db9 (patch) | |
tree | 6b5380fc7b1cd574073f881fb06143063871fef1 /platform | |
parent | cbb7112e8c2a79a4777a1e439029686dc3e3547e (diff) | |
download | qtlocation-mapboxgl-164ff72297a0b57c42cc5dc1299e6b7f1dd13db9.tar.gz |
Fall back on MGLAccountManager access token
Makes IB designables aware of access tokens set via Info.plist.
Diffstat (limited to 'platform')
-rw-r--r-- | platform/ios/MGLMapView.mm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/platform/ios/MGLMapView.mm b/platform/ios/MGLMapView.mm index c928dd6aec..4be5d20d27 100644 --- a/platform/ios/MGLMapView.mm +++ b/platform/ios/MGLMapView.mm @@ -153,7 +153,8 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration) - (NSString *)accessToken { - return @(_mbglMap->getAccessToken().c_str()).mgl_stringOrNilIfEmpty; + NSString *accessToken = @(_mbglMap->getAccessToken().c_str()).mgl_stringOrNilIfEmpty; + return accessToken ? accessToken : [MGLAccountManager accessToken]; } - (void)setAccessToken:(NSString *)accessToken @@ -2559,7 +2560,7 @@ CLLocationCoordinate2D latLngToCoordinate(mbgl::LatLng latLng) // More explanation UILabel *explanationLabel2 = [[UILabel alloc] init]; - explanationLabel2.text = @"and enter it into the Access Token field in the Attributes inspector."; + explanationLabel2.text = @"and enter it into the Access Token field in the Attributes inspector or in an MGLMapboxAccessToken entry in the Info.plist file."; explanationLabel2.font = [UIFont preferredFontForTextStyle:UIFontTextStyleBody]; explanationLabel2.numberOfLines = 0; explanationLabel2.translatesAutoresizingMaskIntoConstraints = NO; |