Issue
This are my classes:
http://wklej.org/id/840949/ - ShopMapActivity
http://wklej.org/id/840950/ - CustomMapView
and I'm trying to draw different number of points depending on zoom. So if zoom is lower than 9 it should draw only points that represent cites. When you zoom in and zoom level is higher than 9 it should draw all points which are in this area.
When activity starts there are only points which represent cities (this is good), when i zoom in to 9 zoom level, in that area appears additional points (which is also good), but when i zoom out from that state, additional points don't disappear, even that I'm cleaning map with:
mapOverlays.clear();
mapView.getOverlays().clear();
mapView.invalidate();
mapView.postInvalidate();
Solution
You forgot to clear your itemizedOverlay. You are removing it from the list of active ovelays, but then you repeat adding the same points to the itemizedOverlay (they were already in there) and the you add it to the active overlays.
Bottom line, just add the following to your code:
itemizedoverlay.clear();
after the line:
mapView.getOverlays().clear();
If you didn't create the method clear() in itemizedOvelay, it's time to do it.
good luck.
Answered By - Luis
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.