[android] reset scale/rotate focal point in each step

This commit is contained in:
Łukasz Paczos
2019-04-01 15:53:03 +02:00
committed by Łukasz Paczos
parent 1aa44d5451
commit c66ec867c9
2 changed files with 45 additions and 57 deletions

View File

@@ -267,7 +267,18 @@ public class GestureDetectorActivity extends AppCompatActivity {
if (enabled) {
focalPointLatLng = new LatLng(51.50325, -0.12968);
marker = mapboxMap.addMarker(new MarkerOptions().position(focalPointLatLng));
mapboxMap.easeCamera(CameraUpdateFactory.newLatLngZoom(focalPointLatLng, 16));
mapboxMap.easeCamera(CameraUpdateFactory.newLatLngZoom(focalPointLatLng, 16),
new MapboxMap.CancelableCallback() {
@Override
public void onCancel() {
recalculateFocalPoint();
}
@Override
public void onFinish() {
recalculateFocalPoint();
}
});
} else {
if (marker != null) {
mapboxMap.removeMarker(marker);