How to get map zoom event in OSMdroid?

I use the Osmdroid library in my custom Android application.

With every zooming (& when zooming in on the map) I want to query the sqlite database and get the records that lie to that extent. To do this, I need something similar to a map change event.

I could not find such an event in the MapView class. How to achieve what I want to do?

UPDATE I am using MapListner as follows:

mapView.setMapListener(new MapListener() { public boolean onZoom(ZoomEvent arg0) { return false; } public boolean onScroll(ScrollEvent arg0) { onExtentChange(); return false; } } ); 

but onScrollEvnt runs several times for each panorama of the map. How to get last or last scrollEvent?

+4
source share
1 answer
 setMapListener(new DelayedMapListener(new MapListener() { public boolean onZoom(final ZoomEvent e) { //do something return true; } public boolean onScroll(final ScrollEvent e) { Log.i("zoom", e.toString()); return true; } }, 1000 )); 
+12
source

All Articles