Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
Fix location permissions ask, add delay for map to load
Browse files Browse the repository at this point in the history
  • Loading branch information
friedbunny committed Sep 4, 2015
1 parent 7789324 commit a077704
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ios/app/MBXViewController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ - (void)viewDidLoad

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];

Expand All @@ -76,6 +75,13 @@ - (void)viewDidLoad

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
Expand Down

0 comments on commit a077704

Please sign in to comment.