Reputation: 7082
I have somewhere in my application called map.animateCamera(...)
.
I want to cancel ANY movement of the map. I am looking for something like map.cancelCameraMove()
or something similar, but unfortunately, it does not exist.
Any help?
Upvotes: 3
Views: 1075
Reputation: 13343
Seems map.stopAnimation()
is what you need:
...
map.animateCamera(location, duration, null);
...
// when need to stop animation
map.stopAnimation();
Or you can use workaround: get current camera position via map.getCameraPosition()
and move it instantaneous exactly to them with map.moveCamera()
. Something like that:
...
map.animateCamera(location, duration, null);
...
// when need to stop animation
CameraPosition cameraPosition = map.getCameraPosition();
map.moveCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));
Upvotes: 2