diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/widgets/MyLocationView.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/widgets/MyLocationView.java index 4f42af329fd..300804c468c 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/widgets/MyLocationView.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/widgets/MyLocationView.java @@ -588,7 +588,7 @@ public void onSensorChanged(SensorEvent event) { private void rotateCamera(float rotation) { CameraPosition.Builder builder = new CameraPosition.Builder(); - builder.bearing(-rotation); + builder.bearing(rotation); mapboxMap.easeCamera(CameraUpdateFactory.newCameraPosition(builder.build()), COMPASS_UPDATE_RATE_MS, false /*linear interpolator*/, false /*do not disable tracking*/, null); } @@ -694,7 +694,7 @@ void updateLatLng(@NonNull Location location) { // add direction if (myBearingTrackingMode == MyBearingTracking.GPS) { if (location.hasBearing()) { - builder.bearing(-location.getBearing()); + builder.bearing(location.getBearing()); } setCompass(0); } diff --git a/platform/android/src/jni.cpp b/platform/android/src/jni.cpp index 01d3a01227b..1168fb9b891 100755 --- a/platform/android/src/jni.cpp +++ b/platform/android/src/jni.cpp @@ -498,7 +498,7 @@ jdoubleArray nativeGetCameraValues(JNIEnv *env, jni::jobject* obj, jlong nativeM jdouble buf[5]; buf[0] = latLng.latitude; buf[1] = latLng.longitude; - buf[2] = -(nativeMapView->getMap().getBearing()-360); + buf[2] = -nativeMapView->getMap().getBearing(); buf[3] = nativeMapView->getMap().getPitch(); buf[4] = nativeMapView->getMap().getZoom(); env->SetDoubleArrayRegion(output, start, leng, buf); @@ -1008,7 +1008,7 @@ void nativeJumpTo(JNIEnv *env, jni::jobject* obj, jlong nativeMapViewPtr, jdoubl mbgl::CameraOptions options; if (angle != -1) { - options.angle = angle * M_PI / 180; + options.angle = (-angle * M_PI) / 180; } options.center = mbgl::LatLng(latitude, longitude); options.padding = nativeMapView->getInsets(); @@ -1028,7 +1028,7 @@ void nativeEaseTo(JNIEnv *env, jni::jobject* obj, jlong nativeMapViewPtr, jdoubl mbgl::CameraOptions cameraOptions; if (angle != -1) { - cameraOptions.angle = angle * M_PI / 180; + cameraOptions.angle = (-angle * M_PI) / 180; } cameraOptions.center = mbgl::LatLng(latitude, longitude); cameraOptions.padding = nativeMapView->getInsets(); @@ -1061,7 +1061,7 @@ void nativeFlyTo(JNIEnv *env, jni::jobject* obj, jlong nativeMapViewPtr, jdouble mbgl::CameraOptions cameraOptions; if (angle != -1) { - cameraOptions.angle = angle * M_PI / 180 ; + cameraOptions.angle = (-angle * M_PI) / 180 ; } cameraOptions.center = mbgl::LatLng(latitude, longitude); cameraOptions.padding = nativeMapView->getInsets();