#1033 - Renaming MBLocationManager to MGLMetricsLocationManager to better comply with naming scheme.
This commit is contained in:
@@ -16,8 +16,8 @@
|
||||
'../platform/darwin/asset_root.mm',
|
||||
'../platform/darwin/image.mm',
|
||||
'../platform/darwin/reachability.m',
|
||||
'../include/mbgl/ios/MBLocationManager.h',
|
||||
'../platform/ios/MBLocationManager.m',
|
||||
'../include/mbgl/ios/MGLMetricsLocationManager.h',
|
||||
'../platform/ios/MGLMetricsLocationManager.m',
|
||||
'../include/mbgl/ios/MGLMapView.h',
|
||||
'../platform/ios/MGLMapView.mm',
|
||||
'../include/mbgl/ios/MGLStyleFunctionValue.h',
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "CoreLocation/CoreLocation.h"
|
||||
|
||||
@interface MBLocationManager : NSObject <CLLocationManagerDelegate>
|
||||
@interface MGLMetricsLocationManager : NSObject <CLLocationManagerDelegate>
|
||||
|
||||
+ (id)sharedManager;
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#import "NSArray+MGLAdditions.h"
|
||||
#import "NSDictionary+MGLAdditions.h"
|
||||
|
||||
#import "MBLocationManager.h"
|
||||
#import "MGLMetricsLocationManager.h"
|
||||
|
||||
|
||||
// Returns the path to the default cache database on this system.
|
||||
@@ -341,7 +341,7 @@ mbgl::DefaultFileSource *mbglFileSource = nullptr;
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appWillForeground:) name:UIApplicationWillEnterForegroundNotification object:nil];
|
||||
|
||||
// Setup MBLocationManager for metrics
|
||||
[MBLocationManager sharedManager];
|
||||
[MGLMetricsLocationManager sharedManager];
|
||||
|
||||
// set initial position
|
||||
//
|
||||
|
||||
@@ -9,20 +9,20 @@
|
||||
// Copyright (c) 2015 Mapbox. All rights reserved.
|
||||
//
|
||||
|
||||
#import "MBLocationManager.h"
|
||||
#import "MGLMetricsLocationManager.h"
|
||||
#import "CoreLocation/CoreLocation.h"
|
||||
|
||||
@interface MBLocationManager()
|
||||
@interface MGLMetricsLocationManager()
|
||||
|
||||
@property (atomic) CLLocationManager *locationManager;
|
||||
@property (atomic) BOOL isBackground;
|
||||
|
||||
@end
|
||||
|
||||
@implementation MBLocationManager
|
||||
@implementation MGLMetricsLocationManager
|
||||
|
||||
|
||||
static MBLocationManager *sharedManager = nil;
|
||||
static MGLMetricsLocationManager *sharedManager = nil;
|
||||
|
||||
- (id) init {
|
||||
if (self = [super init]) {
|
||||
@@ -119,24 +119,24 @@ static MBLocationManager *sharedManager = nil;
|
||||
break;
|
||||
case kCLAuthorizationStatusDenied:
|
||||
newStatus = @"User Explcitly Denied";
|
||||
[[MBLocationManager sharedManager] stopUpdatingLocation];
|
||||
[[MGLMetricsLocationManager sharedManager] stopUpdatingLocation];
|
||||
break;
|
||||
case kCLAuthorizationStatusAuthorized:
|
||||
newStatus = @"User Has Authorized / Authorized Always";
|
||||
[[MBLocationManager sharedManager] startUpdatingLocation];
|
||||
[[MGLMetricsLocationManager sharedManager] startUpdatingLocation];
|
||||
break;
|
||||
// case kCLAuthorizationStatusAuthorizedAlways:
|
||||
// newStatus = @"Not Determined";
|
||||
// break;
|
||||
case kCLAuthorizationStatusAuthorizedWhenInUse:
|
||||
newStatus = @"User Has Authorized When In Use Only";
|
||||
[[MBLocationManager sharedManager] startUpdatingLocation];
|
||||
[[MGLMetricsLocationManager sharedManager] startUpdatingLocation];
|
||||
break;
|
||||
default:
|
||||
newStatus = @"Unknown";
|
||||
break;
|
||||
}
|
||||
NSLog(@"MBLocationManager didChangeAuthorizationStatus() called. New Status = %@", newStatus);
|
||||
NSLog(@"MGLMetricsLocationManager didChangeAuthorizationStatus() called. New Status = %@", newStatus);
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user