diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2016-04-18 11:32:11 -0700 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2016-04-18 14:19:09 -0700 |
commit | a392f972fca0e8d7bedbda8a7fe6410567682195 (patch) | |
tree | 275a8bbb6b7f818ca3c8503e1649c56df9414040 /platform/ios/benchmark | |
parent | bc3512773ffe942e6f70c43596490a6fcf8920a4 (diff) | |
download | qtlocation-mapboxgl-a392f972fca0e8d7bedbda8a7fe6410567682195.tar.gz |
[ios] Use downloaded local assets in ios-bench if present
If you’ve gone through the trouble of running iso-bench’s download.sh scripts, use those assets instead of fetching them at runtime from the server.
Diffstat (limited to 'platform/ios/benchmark')
-rw-r--r-- | platform/ios/benchmark/MBXBenchViewController.mm | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/platform/ios/benchmark/MBXBenchViewController.mm b/platform/ios/benchmark/MBXBenchViewController.mm index 3d8034b2b3..07975de491 100644 --- a/platform/ios/benchmark/MBXBenchViewController.mm +++ b/platform/ios/benchmark/MBXBenchViewController.mm @@ -44,7 +44,9 @@ { [super viewDidLoad]; - NSURL* url = [[NSURL alloc] initWithString:@"mapbox://styles/mapbox/streets-v8"]; + // Use a local style and local assets if they’ve been downloaded. + NSURL *tileSourceURL = [[NSBundle mainBundle] URLForResource:@"mapbox.mapbox-terrain-v2,mapbox.mapbox-streets-v6" withExtension:nil subdirectory:@"tiles"]; + NSURL *url = [NSURL URLWithString:tileSourceURL ? @"asset://styles/streets-v8.json" : @"mapbox://styles/mapbox/streets-v8"]; self.mapView = [[MGLMapView alloc] initWithFrame:self.view.bounds styleURL:url]; self.mapView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; self.mapView.delegate = self; |