Handler for Map panning and zooming

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

Handler for Map panning and zooming

Postby gostyloj » Tue Apr 28, 2009 1:45 pm

I have a bunch of server data that my client turns into overlays. I don't want to load it all at once. When the user pans to a new location I want to start a process that loads the data for that new location. I cannot find a hook in the process that tells me when the map has been panned. I have found one method that does half the job, but it seem like the process should be more straight forward.

Right now I am extending MapView and overriding dispatchTouchEvent and watching for the event to be ACTION_UP. This captures the panning, but not the zooming. The zooming seems more tricky because there are already zoom controls with the map. My best guess is extend the zoom controls to MyZoomControls and add that as another zoom controller in MyMapView that I already extended.

This seems like overkill. That is why I wanted to know if there is a more unified way of handling when the map that is inside the MapView has finished animating. I tried overriding onAnimationEnd() from MapView but I think that is looking for an animation of the entire view and not the map inside. I was thinking I could implement AnimationListener on MyMapView but if that does work I don't know how to register MyMapView to listen for the internal map. What kind of object is the map inside the view??

Thanks for whatever help you can provide.
gostyloj
Freshman
Freshman
 
Posts: 6
Joined: Tue Apr 28, 2009 12:52 pm

Top

Re: Handler for Map panning and zooming

Postby tanran » Sat Jul 18, 2009 8:53 am

[quote="gostyloj"]I have a bunch of server data that my client turns into overlays....
quote]
now i have the same problem with u. have u solved the problem above?
i think one way is control the map by the button added manully, and handle the click event
to get the map center and latitude span and longitude span.

if u have solved the problem u said, can u tell me? And we can talk about it .
tanran
Junior Developer
Junior Developer
 
Posts: 12
Joined: Wed Apr 22, 2009 2:16 am

Postby Christoph » Tue Jul 21, 2009 3:28 am

hi guys,
please check out http://code.google.com/p/mapview-overlay-manager/
and give me some feedback if it helped you :)

my new library comes with lazyloading out of the box :)
User avatar
Christoph
Developer
Developer
 
Posts: 28
Joined: Thu Jul 02, 2009 3:34 am
Location: Bonn, Germany

Top

Return to Map Problems

Who is online

Users browsing this forum: Exabot [Bot], Yahoo [Bot] and 7 guests