diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Transform.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Transform.java index 9a8997014a5..505e440dcb9 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Transform.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Transform.java @@ -150,6 +150,10 @@ CameraPosition invalidateCameraPosition() { cameraChangeDispatcher.onCameraMove(); } + if (isComponentUpdateRequired(cameraPosition)) { + updateCameraPosition(cameraPosition); + } + this.cameraPosition = cameraPosition; if (onCameraChangeListener != null) { onCameraChangeListener.onCameraChange(this.cameraPosition); @@ -158,6 +162,11 @@ CameraPosition invalidateCameraPosition() { return cameraPosition; } + private boolean isComponentUpdateRequired(@NonNull CameraPosition cameraPosition) { + return this.cameraPosition != null && (this.cameraPosition.tilt != cameraPosition.tilt + || this.cameraPosition.bearing != cameraPosition.bearing); + } + void cancelTransitions() { // notify user about cancel cameraChangeDispatcher.onCameraMoveCanceled();