diff options
author | Ivo van Dongen <info@ivovandongen.nl> | 2016-11-30 10:38:51 +0200 |
---|---|---|
committer | Ivo van Dongen <ivovandongen@users.noreply.github.com> | 2016-12-02 13:58:55 +0200 |
commit | 5cf061f3a5111e12c3c5e3e926fa207a809e6d5f (patch) | |
tree | 6890c98144bdf28fc32f873d22b15583b9beb85f | |
parent | b3ec26f2828cf19f7262cbe5af03d9cd39ec8fb3 (diff) | |
download | qtlocation-mapboxgl-5cf061f3a5111e12c3c5e3e926fa207a809e6d5f.tar.gz |
[android] telemetry - horizontal accuracy
-rw-r--r-- | platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/telemetry/MapboxEventManager.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/telemetry/MapboxEventManager.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/telemetry/MapboxEventManager.java index bedb54ca46..791df3c882 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/telemetry/MapboxEventManager.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/telemetry/MapboxEventManager.java @@ -332,16 +332,17 @@ public class MapboxEventManager { /** * Adds a Location Event to the system for processing + * * @param location Location event */ public void addLocationEvent(Location location) { // NaN and Infinite checks to prevent JSON errors at send to server time - if (Double.isNaN(location.getLatitude()) || Double.isNaN(location.getLongitude()) || Double.isNaN(location.getAltitude())) { + if (Double.isNaN(location.getLatitude()) || Double.isNaN(location.getLongitude()) || Double.isNaN(location.getAltitude()) || Float.isNaN(location.getAccuracy())) { return; } - if (Double.isInfinite(location.getLatitude()) || Double.isInfinite(location.getLongitude()) || Double.isInfinite(location.getAltitude())) { + if (Double.isInfinite(location.getLatitude()) || Double.isInfinite(location.getLongitude()) || Double.isInfinite(location.getAltitude()) || Float.isInfinite(location.getAccuracy())) { return; } @@ -354,6 +355,7 @@ public class MapboxEventManager { event.put(MapboxEvent.KEY_LATITUDE, Math.floor(location.getLatitude() * locationEventAccuracy) / locationEventAccuracy); event.put(MapboxEvent.KEY_LONGITUDE, Math.floor(location.getLongitude() * locationEventAccuracy) / locationEventAccuracy); event.put(MapboxEvent.KEY_ALTITUDE, location.getAltitude()); + event.put(MapboxEvent.KEY_HORIZONTAL_ACCURACY, Math.round(location.getAccuracy())); event.put(MapboxEvent.ATTRIBUTE_OPERATING_SYSTEM, operatingSystem); event.put(MapboxEvent.ATTRIBUTE_APPLICATION_STATE, getApplicationState()); |