summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Guerra <fabian.guerra@mapbox.com>2018-06-25 12:02:17 -0700
committerFabian Guerra <fabian.guerra@mapbox.com>2018-07-20 09:46:38 -0700
commit2441e6857e309c86dda721070c43683f7efb1607 (patch)
tree5f900de43d2c9f50fc8b067516b0ba2a25ada31c
parent6beaf6402b2c19693f7257c48919d8af69bbba16 (diff)
downloadqtlocation-mapboxgl-2441e6857e309c86dda721070c43683f7efb1607.tar.gz
[ios] Remove CLLocationManager usage.
-rw-r--r--platform/ios/src/MGLMapView.mm9
1 files changed, 6 insertions, 3 deletions
diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm
index 846b01fe9d..bf6210137a 100644
--- a/platform/ios/src/MGLMapView.mm
+++ b/platform/ios/src/MGLMapView.mm
@@ -4698,11 +4698,14 @@ public:
{
BOOL shouldEnableLocationServices = self.showsUserLocation && !self.dormant;
- if (shouldEnableLocationServices && ! self.locationManager)
+ if (shouldEnableLocationServices)
{
- self.locationManager = [[MGLCLLocationManager alloc] init];
+ // If no custom location manager is provided will use the internal implementation.
+ if (!self.locationManager) {
+ self.locationManager = [[MGLCLLocationManager alloc] init];
+ }
- if ([CLLocationManager authorizationStatus] == kCLAuthorizationStatusNotDetermined)
+ if (self.locationManager.authorizationStatus == kCLAuthorizationStatusNotDetermined)
{
BOOL requiresWhenInUseUsageDescription = [NSProcessInfo.processInfo isOperatingSystemAtLeastVersion:(NSOperatingSystemVersion){11,0,0}];
BOOL hasWhenInUseUsageDescription = !![[NSBundle mainBundle] objectForInfoDictionaryKey:@"NSLocationWhenInUseUsageDescription"];