Listening for map panning and zooming

Put problem concerning MapActivities, MapViews, Overlays and GPS in this forum.

Listening for map panning and zooming

Postby michaelz » Sun Jul 04, 2010 7:05 am

Does anyone have any advice on how to check for map zooming and panning?
michaelz
Developer
Developer
 
Posts: 26
Joined: Tue Jun 29, 2010 3:16 am

Top

Re: Listening for map panning and zooming

Postby anarche » Sun Jul 04, 2010 7:10 am

You can use an onTouchListener attached to the zoom buttons to detect touches. Make sure that your onTouchListener - after completing its functionality - returns false so that the event is then passed to the actual zoom itself.

Ditto for an onTouchListener on the actual MapView
anarche
Master Developer
Master Developer
 
Posts: 369
Joined: Sun Apr 11, 2010 5:21 am

Re: Listening for map panning and zooming

Postby michaelz » Sun Jul 04, 2010 7:46 am

Thanks! how could that be attached to the maps built-in zoom controls?
michaelz
Developer
Developer
 
Posts: 26
Joined: Tue Jun 29, 2010 3:16 am

Re: Listening for map panning and zooming

Postby anarche » Sun Jul 04, 2010 8:32 am

Ok I can't seem to find an access to the inbuilt controls without using the deprecated MapView.getZoomControls()

But you can add your own ZoomControl example here or - as a hack - iterate through the MapView's children views and see if it is an instanceof ZoomControl
anarche
Master Developer
Master Developer
 
Posts: 369
Joined: Sun Apr 11, 2010 5:21 am

Top

Return to Map Problems

Who is online

Users browsing this forum: Yahoo [Bot] and 3 guests