Fix location permissions ask, add delay for map to load

This commit is contained in:
Jason Wray
2015-09-04 17:48:34 -04:00
parent 77893249fc
commit a07770450c

View File

@@ -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