summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorTobrun <tobrun@mapbox.com>2017-06-09 11:11:33 +0200
committerGitHub <noreply@github.com>2017-06-09 11:11:33 +0200
commitfa972fad60e58e5b8f9f9622f508e9732c8c9ffd (patch)
tree7ba11f1e109ae3ecfdc603229ef29868b18bd291 /platform
parent9f88e373665124464351424e1efc95fe3a1fc05d (diff)
downloadqtlocation-mapboxgl-fa972fad60e58e5b8f9f9622f508e9732c8c9ffd.tar.gz
[android] - update components with camera values when animating (#9174)
Diffstat (limited to 'platform')
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Transform.java9
1 files changed, 9 insertions, 0 deletions
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 9a8997014a..505e440dcb 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 @@ final class Transform implements MapView.OnMapChangedListener {
cameraChangeDispatcher.onCameraMove();
}
+ if (isComponentUpdateRequired(cameraPosition)) {
+ updateCameraPosition(cameraPosition);
+ }
+
this.cameraPosition = cameraPosition;
if (onCameraChangeListener != null) {
onCameraChangeListener.onCameraChange(this.cameraPosition);
@@ -158,6 +162,11 @@ final class Transform implements MapView.OnMapChangedListener {
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();