diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2015-11-20 00:13:44 -0800 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2015-11-20 10:44:12 -0800 |
commit | b3dbdb389ff712ace00857e3e72894f0bb3afe3a (patch) | |
tree | 006da1f49848767ca6d3bcd92376e0b1f2d38357 /platform/ios | |
parent | 566b108248b0b69a61d5e0c0efe3b7fda550e590 (diff) | |
download | qtlocation-mapboxgl-b3dbdb389ff712ace00857e3e72894f0bb3afe3a.tar.gz |
[iOS] Set application root as asset root
As of #2746, we no longer bundle any styles with the SDK, so the asset: URL scheme is unused. Instead, point asset: to the application root for developer convenience and consistency with the Android and default asset roots. Also fixed an issue that prevented relative URLs from being treated as asset: URLs.
Fixes #1208, fixes #3050.
Diffstat (limited to 'platform/ios')
-rw-r--r-- | platform/ios/MGLMapView.mm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/platform/ios/MGLMapView.mm b/platform/ios/MGLMapView.mm index ce7cefa401..b088185f00 100644 --- a/platform/ios/MGLMapView.mm +++ b/platform/ios/MGLMapView.mm @@ -192,8 +192,8 @@ std::chrono::steady_clock::duration durationInSeconds(float duration) if ( ! [styleURL scheme]) { - // Assume a relative path into the developer’s bundle. - styleURL = [[NSBundle mainBundle] URLForResource:styleURL.path withExtension:nil]; + // Assume a relative path into the application bundle. + styleURL = [NSURL URLWithString:[@"asset://" stringByAppendingString:[styleURL absoluteString]]]; } _mbglMap->setStyleURL([[styleURL absoluteString] UTF8String]); |