[android] - when updating positon, wait for render call to invalidate updated marker position, correct camera invalidation for all moveCamera method invocations (#7794)

This commit is contained in:
Tobrun
2017-01-23 18:43:57 +01:00
committed by GitHub
parent 0ccc255f0e
commit 7cf317c08c
2 changed files with 4 additions and 3 deletions

View File

@@ -342,6 +342,7 @@ public class MarkerView extends Marker {
public void setPosition(LatLng position) {
super.setPosition(position);
if (markerViewManager != null) {
markerViewManager.setWaitingForRenderInvoke(true);
markerViewManager.update();
}
}

View File

@@ -515,9 +515,6 @@ public final class MapboxMap {
@UiThread
public final void moveCamera(CameraUpdate update) {
moveCamera(update, null);
// MapChange.REGION_DID_CHANGE_ANIMATED is not called for `jumpTo`
// invalidate camera position to provide OnCameraChange event.
invalidateCameraPosition();
}
/**
@@ -534,6 +531,9 @@ public final class MapboxMap {
@Override
public void run() {
transform.moveCamera(MapboxMap.this, update, callback);
// MapChange.REGION_DID_CHANGE_ANIMATED is not called for `jumpTo`
// invalidate camera position to provide OnCameraChange event.
invalidateCameraPosition();
}
});
}