Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MapView setCenter() not working properly

I have an Activity, where is a MapView on part of screen. Here I always center location to given point. Then I have another activity, where is MapView on whole screen and I center to users location. When I came back from whole screen MapView activity to activity with MapView on part of a screen, I call setCenter() on MapView again. But now MapView isn't centered on right location but few meters elsewhere. When I use animateTo(), everything works as expected. Is it any setCenter() bug or how should I explain this strange behaviour to myself?

like image 282
sealskej Avatar asked Feb 22 '23 03:02

sealskej


1 Answers

Well, the working solution is to use this:

controller.setCenter(getPoint);
controller.animateTo(getPoint);
like image 163
sealskej Avatar answered Mar 03 '23 16:03

sealskej