diff options
author | Bharath MG <mgbharath@ymail.com> | 2018-12-13 10:57:23 +0530 |
---|---|---|
committer | Łukasz Paczos <lukasz.paczos@mapbox.com> | 2018-12-13 10:30:44 +0100 |
commit | 25286011e5bd22d81bd90a047cd25dc89db078d8 (patch) | |
tree | 509d6cab52391c19fa12e8ec135f39767c6c1891 | |
parent | e84748c17039c3c6911504d9f8e729e7a8e92c1a (diff) | |
download | qtlocation-mapboxgl-25286011e5bd22d81bd90a047cd25dc89db078d8.tar.gz |
Fixed compass update time not getting updated
-rw-r--r-- | platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationComponentCompassEngine.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationComponentCompassEngine.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationComponentCompassEngine.java index b47f8d7afb..2e33bfd84f 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationComponentCompassEngine.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationComponentCompassEngine.java @@ -127,9 +127,6 @@ class LocationComponentCompassEngine implements CompassEngine, SensorEventListen if (event.sensor.getType() == Sensor.TYPE_ROTATION_VECTOR) { rotationVectorValue = getRotationVectorFromSensorEvent(event); updateOrientation(); - - // Update the compassUpdateNextTimestamp - compassUpdateNextTimestamp = currentTime + LocationComponentConstants.COMPASS_UPDATE_RATE_MS; } else if (event.sensor.getType() == Sensor.TYPE_ORIENTATION) { notifyCompassChangeListeners((event.values[0] + 360) % 360); } else if (event.sensor.getType() == Sensor.TYPE_ACCELEROMETER) { @@ -139,6 +136,9 @@ class LocationComponentCompassEngine implements CompassEngine, SensorEventListen magneticValues = lowPassFilter(getRotationVectorFromSensorEvent(event), magneticValues); updateOrientation(); } + + // Update the compassUpdateNextTimestamp + compassUpdateNextTimestamp = currentTime + LocationComponentConstants.COMPASS_UPDATE_RATE_MS; } @Override |