summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Bounds <jesse@rebounds.net>2016-12-05 11:47:13 -0800
committerJesse Bounds <jesse@rebounds.net>2016-12-05 15:10:38 -0800
commit5579e67804369777819babba5cf6e25eb91ee77e (patch)
treef766aea250839b17a3d82b7370525d771725cb7f
parent4a61fcdafbe6e81544120f170c22f58f33aebe04 (diff)
downloadqtlocation-mapboxgl-5579e67804369777819babba5cf6e25eb91ee77e.tar.gz
[ios] Round horizontal accuracy
-rw-r--r--platform/ios/src/MGLMapboxEvents.m3
1 files changed, 2 insertions, 1 deletions
diff --git a/platform/ios/src/MGLMapboxEvents.m b/platform/ios/src/MGLMapboxEvents.m
index 210f66bc28..2658cdfaa4 100644
--- a/platform/ios/src/MGLMapboxEvents.m
+++ b/platform/ios/src/MGLMapboxEvents.m
@@ -656,12 +656,13 @@ const NSTimeInterval MGLFlushInterval = 180;
double accuracy = 10000000;
double lat = floor(loc.coordinate.latitude * accuracy) / accuracy;
double lng = floor(loc.coordinate.longitude * accuracy) / accuracy;
+ double horizontalAccuracy = round(loc.horizontalAccuracy);
NSString *formattedDate = [self.rfc3339DateFormatter stringFromDate:loc.timestamp];
[MGLMapboxEvents pushEvent:MGLEventTypeLocation withAttributes:@{MGLEventKeyCreated: formattedDate,
MGLEventKeyLatitude: @(lat),
MGLEventKeyLongitude: @(lng),
MGLEventKeyAltitude: @(round(loc.altitude)),
- MGLEventHorizontalAccuracy: @(loc.horizontalAccuracy)}];
+ MGLEventHorizontalAccuracy: @(horizontalAccuracy)}];
}
}