Issue
i want to update a polygon i draw on the mapview for every zoomlevel. how can i get a notivication when mapview is zoomed in or out?
BR
Solution
Unfortunately there is no native callback which notifies you about zoom level change. What you can do - is extend native map view and look for zoom level change inside onDraw method:
public final class CustomMapView extends MapView
{
private int lastZoomLevel = -1;
@Override
public void draw(Canvas canvas)
{
if (isZoomChange())
{
lastZoomLevel = this.getZoomLevel();
onZoomLevelChange(lastZoomLevel); //this would be your notification function
}
super.draw(canvas);
}
private boolean isZoomChange()
{
return (getZoomLevel() != lastZoomLevel);
}
}
Answered By - Pavel Dudka
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.