I'd like to dynamically update the map/ load new map overlays every time my user moves it a certain amount of distance. How do I go about doing this? Is there a listener for every time the user moves the map? Most likely I'd just measure the distance between the center points.
Thanks!
Google Earth will now play live video feeds from select locations across the globe. The feature is available outright on different platforms supported by Google Earth.
Try this to detect the map movements: http://pa.rezendi.com/2010/03/responding-to-zooms-and-pans-in.html
On start and after the map has been moved, you should save the current map center. As the article suggests, track ACTION_UP to determine when the user has finished a map movement. Then, compare the new map center with the old map center. To get the map centers use MapView's getMapCenter():
http://code.google.com/android/add-ons/google-apis/reference/com/google/android/maps/MapView.html#getMapCenter()
EDIT: I have done some additional work on this, and have a complete application with code for your enjoyment. This blog post explains a timer solution to this and contains a link to Github source: http://bricolsoftconsulting.com/extending-mapview-to-add-a-change-event/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With