From 46eec5279b0bb15af2278c9eb1fc041c3a5a14e0 Mon Sep 17 00:00:00 2001 From: Guardiola31337 Date: Thu, 27 Jul 2017 15:02:52 +0200 Subject: [PATCH] [android] fix compass direction (Transform::getCameraOptions returns counterclockwise angle after transform.invalidateCameraPosition() which needs to be transformed to a clockwise bearing) --- .../src/main/java/com/mapbox/mapboxsdk/maps/UiSettings.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/UiSettings.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/UiSettings.java index e8891429f9a..e71d509fcfa 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/UiSettings.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/UiSettings.java @@ -427,7 +427,8 @@ void update(@NonNull CameraPosition cameraPosition) { return; } - compassView.update(cameraPosition.bearing); + double clockwiseBearing = -cameraPosition.bearing; + compassView.update(clockwiseBearing); } /**