summaryrefslogtreecommitdiff
path: root/platform/ios/src/MGLMapboxEvents.m
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2016-12-03 15:36:42 -0800
committerMinh Nguyễn <mxn@1ec5.org>2016-12-03 15:36:42 -0800
commit3503c0e7679d5802068fc2ab2420b575a8ae2fc7 (patch)
treed1cfdd3ca2f2fb9761466a61e77d82d8f6b76002 /platform/ios/src/MGLMapboxEvents.m
parent84038832e45c2445b43b39ccb2f9e29c8646dac0 (diff)
parent9eb7f88b2c292d322a104c4580c3ef29958b628b (diff)
downloadqtlocation-mapboxgl-3503c0e7679d5802068fc2ab2420b575a8ae2fc7.tar.gz
Merge branch 'release-ios-v3.4.0' into 1ec5-release-ios-v3.4.0-beta.4-master
Diffstat (limited to 'platform/ios/src/MGLMapboxEvents.m')
-rw-r--r--platform/ios/src/MGLMapboxEvents.m14
1 files changed, 3 insertions, 11 deletions
diff --git a/platform/ios/src/MGLMapboxEvents.m b/platform/ios/src/MGLMapboxEvents.m
index e26ca51f8e..01c46b5c8b 100644
--- a/platform/ios/src/MGLMapboxEvents.m
+++ b/platform/ios/src/MGLMapboxEvents.m
@@ -35,6 +35,7 @@ NSString *const MGLEventKeyZoomLevel = @"zoom";
NSString *const MGLEventKeySpeed = @"speed";
NSString *const MGLEventKeyCourse = @"course";
NSString *const MGLEventKeyGestureID = @"gesture";
+NSString *const MGLEventHorizontalAccuracy = @"horizontalAccuracy";
NSString *const MGLEventKeyLocalDebugDescription = @"debug.description";
static NSString *const MGLEventKeyEvent = @"event";
@@ -46,7 +47,6 @@ static NSString *const MGLEventKeyOperatingSystem = @"operatingSystem";
static NSString *const MGLEventKeyResolution = @"resolution";
static NSString *const MGLEventKeyAccessibilityFontScale = @"accessibilityFontScale";
static NSString *const MGLEventKeyOrientation = @"orientation";
-static NSString *const MGLEventKeyBatteryLevel = @"batteryLevel";
static NSString *const MGLEventKeyPluggedIn = @"pluggedIn";
static NSString *const MGLEventKeyWifi = @"wifi";
static NSString *const MGLEventKeySource = @"source";
@@ -190,9 +190,6 @@ const NSTimeInterval MGLFlushInterval = 180;
// Clear Any System TimeZone Cache
[NSTimeZone resetSystemTimeZone];
[_rfc3339DateFormatter setTimeZone:[NSTimeZone systemTimeZone]];
-
- // Enable Battery Monitoring
- [UIDevice currentDevice].batteryMonitoringEnabled = YES;
// Configure logging
if ([self isProbablyAppStoreBuild]) {
@@ -454,7 +451,6 @@ const NSTimeInterval MGLFlushInterval = 180;
MGLEventKeyResolution: @(self.data.scale),
MGLEventKeyAccessibilityFontScale: @([self contentSizeScale]),
MGLEventKeyOrientation: [self deviceOrientation],
- MGLEventKeyBatteryLevel: @([self batteryLevel]),
MGLEventKeyWifi: @([[MGLReachability reachabilityForLocalWiFi] isReachableViaWiFi])} mutableCopy];
[self addBatteryStateToAttributes:attributes];
return [self eventForAttributes:attributes attributeDictionary:attributeDictionary];
@@ -475,7 +471,6 @@ const NSTimeInterval MGLFlushInterval = 180;
- (MGLMutableMapboxEventAttributes *)interactionEvent {
MGLMutableMapboxEventAttributes *attributes = [@{MGLEventKeyCreated: [self.rfc3339DateFormatter stringFromDate:[NSDate date]],
MGLEventKeyOrientation: [self deviceOrientation],
- MGLEventKeyBatteryLevel: @([self batteryLevel]),
MGLEventKeyWifi: @([[MGLReachability reachabilityForLocalWiFi] isReachableViaWiFi])} mutableCopy];
[self addBatteryStateToAttributes:attributes];
return attributes;
@@ -519,10 +514,6 @@ const NSTimeInterval MGLFlushInterval = 180;
repeats:YES];
}
-- (NSInteger)batteryLevel {
- return [[NSNumber numberWithFloat:roundf(100 * [UIDevice currentDevice].batteryLevel)] integerValue];
-}
-
- (NSString *)deviceOrientation {
NSString *result;
@@ -669,7 +660,8 @@ const NSTimeInterval MGLFlushInterval = 180;
[MGLMapboxEvents pushEvent:MGLEventTypeLocation withAttributes:@{MGLEventKeyCreated: formattedDate,
MGLEventKeyLatitude: @(lat),
MGLEventKeyLongitude: @(lng),
- MGLEventKeyAltitude: @(round(loc.altitude))}];
+ MGLEventKeyAltitude: @(round(loc.altitude)),
+ MGLEventHorizontalAccuracy: @(loc.horizontalAccuracy)}];
}
}