summaryrefslogtreecommitdiff
path: root/platform/ios
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2015-11-20 00:13:44 -0800
committerMinh Nguyễn <mxn@1ec5.org>2015-11-20 11:20:35 -0800
commitc4558d48f2ac74b3c2413eb8c363688e430b1177 (patch)
treedd8c07d0c8cc4d3286c223a405d817ac60f69107 /platform/ios
parent462af73b7eab4b568779fc3a13adcca009db84e1 (diff)
downloadqtlocation-mapboxgl-c4558d48f2ac74b3c2413eb8c363688e430b1177.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.mm4
1 files changed, 2 insertions, 2 deletions
diff --git a/platform/ios/MGLMapView.mm b/platform/ios/MGLMapView.mm
index f06e648d23..646e02cc7b 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]);