diff options
author | Jason Wray <jason@kulturny.com> | 2015-09-04 17:48:34 -0400 |
---|---|---|
committer | Jason Wray <jason@kulturny.com> | 2015-09-04 17:54:46 -0400 |
commit | a07770450cc86980b087e5f1e00733fa41a6eff6 (patch) | |
tree | 1cb2105595c09b94f44d99d026264a6671134638 /ios | |
parent | 77893249fc8ea5e5f0a529d3f33a06a72b799972 (diff) | |
download | qtlocation-mapboxgl-a07770450cc86980b087e5f1e00733fa41a6eff6.tar.gz |
Fix location permissions ask, add delay for map to load
Diffstat (limited to 'ios')
-rw-r--r-- | ios/app/MBXViewController.mm | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ios/app/MBXViewController.mm b/ios/app/MBXViewController.mm index 99c207d24d..af25fa4dc5 100644 --- a/ios/app/MBXViewController.mm +++ b/ios/app/MBXViewController.mm @@ -49,7 +49,6 @@ mbgl::Settings_NSUserDefaults *settings = nullptr; self.mapView = [[MGLMapView alloc] initWithFrame:self.view.bounds]; self.mapView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; - self.mapView.showsUserLocation = YES; self.mapView.delegate = self; [self.view addSubview:self.mapView]; @@ -76,6 +75,13 @@ mbgl::Settings_NSUserDefaults *settings = nullptr; settings = new mbgl::Settings_NSUserDefaults(); [self restoreState:nil]; + + if ( ! settings->showsUserLocation) + { + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 2 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{ + self.mapView.showsUserLocation = YES; + }); + } } - (void)saveState:(__unused NSNotification *)notification |