diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2015-05-04 14:01:10 -0400 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2015-05-04 14:01:10 -0400 |
commit | 0a03f8bf5e96f7b16f43a336da605d0fcdddf9d6 (patch) | |
tree | 2561a295e7f864df376f8af279705c867b71c16b /platform | |
parent | 539d1be219f164b1e4f096a76ca24056305ab2e8 (diff) | |
parent | 98dc0b6f81b1acf5ab30dc376a9ea44e9ed3923b (diff) | |
download | qtlocation-mapboxgl-0a03f8bf5e96f7b16f43a336da605d0fcdddf9d6.tar.gz |
Merge pull request #1400 from mapbox/1ec5-disable-events-163
Avoid creating MGLMapboxEvents when Metrics is disabled
Diffstat (limited to 'platform')
-rw-r--r-- | platform/ios/MGLMapboxEvents.m | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/platform/ios/MGLMapboxEvents.m b/platform/ios/MGLMapboxEvents.m index be299daf90..36ed63d334 100644 --- a/platform/ios/MGLMapboxEvents.m +++ b/platform/ios/MGLMapboxEvents.m @@ -214,13 +214,14 @@ NSString *const MGLEventGestureRotateStart = @"Rotation"; } // Can be called from any thread. Called implicitly from any -// public class convenience methods. +// public class convenience methods. May return nil if this feature is disabled. // + (instancetype)sharedManager { static dispatch_once_t onceToken; static MGLMapboxEvents *_sharedManager; dispatch_once(&onceToken, ^{ - if ( ! NSProcessInfo.processInfo.mgl_isInterfaceBuilderDesignablesAgent) { + if ( ! NSProcessInfo.processInfo.mgl_isInterfaceBuilderDesignablesAgent && + [[NSUserDefaults standardUserDefaults] objectForKey:@"mapbox_metrics_disabled"] == nil) { void (^setupBlock)() = ^{ _sharedManager = [[self alloc] init]; }; @@ -331,12 +332,6 @@ NSString *const MGLEventGestureRotateStart = @"Rotation"; return; } - // Add Metrics Disabled App Wide Check - if ([[NSUserDefaults standardUserDefaults] objectForKey:@"mapbox_metrics_disabled"] != nil) { - [_eventQueue removeAllObjects]; - return; - } - // Metrics Collection Has Been Paused if (_paused) { return; |