Issue
In order to animate to some point on map i use
myMapController.animateTo(point);
But sometimes I have to run another animation to point. In order not to have some elements flashing I need to stop last animation.
I tried this two:
myMapController.stopPanning()
myMapController.stopAnimation(false);
but it didn't help
Any ideas?
Thanks!
Solution
To stop animation you need to call the method bellow with parameter true (not false as in your question):
myMapController.stopAnimation(true);
This stops the animation and moves map instantanely to the final location requested by animateTo().
If you want to stop animation and keep the map in the position where it was (in the midle of animation), use the following:
GeoPoint movingCenter = mapView.getProjection().fromPixels(mapView.getWidth()/2, mapView.getHeight()/2);
myMapController.stopAnimation(true);
myMapController.setCenter(movingCenter);
Regards.
Answered By - Luis
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.