views:

236

answers:

1

Hi There, Could some one advice, how can i got only one/Unique marker on google map v3. All previous markers should be removed when i create new makrer on map.

Thanks

+2  A: 

You need to keep track (an array) of all the marker objects on your map. You need to iterate through them, setting their map property to null. From the docs:

To remove a marker, call the setMap() method passing null as the argument.

http://code.google.com/apis/maps/documentation/v3/overlays.html#Markers

Nate B
thanks for help
leo
I've used MarkerManager to handle multiple markers, works with zoom-based Markers for instance (only show a couple / one marker at a given zoom level, for instance). It's available for v2 and v3.
Dr1Ku