Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Weird Overlay draw behaviour when zooming in the MapView

I've extended Overlay and implemented draw() in order to draw some stuff onto the map. When zooming is done through mapController.zoomIn() (called when doubleTapping the map), the overlay is drawn properly onto the map.

But whenever I zoom in/out with the built in zoom controller, the overlay is not drawn properly and panning the map is needed to get the overlay refreshed.

like image 828
Itsik Avatar asked May 08 '10 07:05

Itsik


2 Answers

You can use zoom controller and get rid of this problem.. (ex: zoomView = (LinearLayout) mapView.getZoomControls(); )

check with this link

http://developer.android.com/reference/android/widget/ZoomButtonsController.html

like image 183
Droidand Avatar answered Nov 22 '22 06:11

Droidand


I've been using zoom controllers with no problem at all. even having drawn multi layers on the map and zoom in/out has no bad effect at all.

I suggest to use as below

mapController = mapView.getController();
mapController.zoomIn();// or .zoomOut()

instead of using setZoom(XX) please use zoomIn() / zoomOut() which makes zooming smoother, this may help making it work better esp with multiple overlays.

like image 33
Yilmaz Guleryuz Avatar answered Nov 22 '22 06:11

Yilmaz Guleryuz