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?
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 ));
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