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

Fix iosapp location ask #2265

Merged
merged 2 commits into from
Sep 7, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 1 addition & 1 deletion ios/app/app-info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<key>NSHumanReadableCopyright</key>
<string>(c) 2014 Mapbox</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>The map will be centered on the user's location.</string>
<string>The map will display the user&apos;s location.</string>
<key>UILaunchStoryboardName</key>
<string>Default</string>
<key>UIRequiredDeviceCapabilities</key>
Expand Down