views:

27

answers:

0

Hey guys.

I have a simple overlay for a Google Map: http://pastebin.com/Rg8miMSh and I add/remove items on it depending on the zoom level. After removing/adding I call populate on the overlay and invalidate on the map view. Everything works just fine, except 1 glitch: after an item was removed, if I tap its location onTap is still triggered and because the OverlayItem is not there anymore i get java.lang.ArrayIndexOutOfBoundsException in com.google.android.maps.ItemizedOverlay.maskHelper(ItemizedOverlay.java:562) (full stack trace - http://pastebin.com/KThn4ZLE )

Anyone knows why this is happening? Initially i called clear and added all items all over again which didn't seems to cause this problem. However having many items this was becoming a performance issue. Adding/removing only the difference works much faster and I would like to keep this method. Thanks!