How to get the Map Extent change event in OSMdroid?
android, osmdroid
Solution
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 ));
Problem
I am using the Osmdroid library in my custom Android App. At every extent change (& when the map is zoomed in) I want to query the sqlite database and get records that lie within that extent. For this I need something similar to a Map Extent change event. I could not find such an event on the MapView Class. How Do I achieve what I want to do? UPDATE I am using the MapListner like this: ``` mapView.setMapListener(new MapListener() { public boolean onZoom(ZoomEvent arg0) { return false; } public boolean onScroll(ScrollEvent arg0) { onExtentChange(); return false; } } ); ``` but the onScrollEvnt is fired several times for each pan of the map. How do I get the last or final scrollEvent?