views:

63

answers:

1

Sometimes when I remove markers they stay around in a "ghost" fashion -- they are clickable but there's no more icon. This is not every time and usually only happens when I remove more than one at a time.

Here's my code for removing markers:

    for(var i in markers) {
       google.maps.event.clearListeners(markers[i], "click");

       markers[i].setMap(null);
       markers[i] = null;

       delete markers[i];
    }

The only way to guarantee that they get removed 100% of the time is to move the map to another position. Then when I move it back they are gone 100% of the time.

Thanks for your help.

A: 

Ah here we go. What was happening actually had nothing to do with Google Maps API. The markers were getting readded at a different location based on presence XMPP updates. I took this out of my application and it works fine.

ewindsor