Page 1 of 1

Clear markers from map

Posted: Thu Jan 08, 2015 12:07 am
by Cristian Hidalgo

I have followed the the tutorials on this matter and also checked the information on:
https://developers.google.com/maps/do...

however when I try to call a function to remove the markers on a map,nothing happens.What am I doing wrong?
Image


Clear markers from map

Posted: Thu Jan 08, 2015 12:09 am
by Cristian Hidalgo

Clear markers from map

Posted: Thu Jan 08, 2015 12:10 am
by Cristian Hidalgo

Any help is appreciated....

Image


Clear markers from map

Posted: Thu Jan 08, 2015 4:31 am
by Yurii Orishchuk

Hi Cristian,

Unfortunatly there is no way to clear all markers without handle them.

But when you have this items (which you want to remove from map) you can remove them with ".setMap(null);" method.

See details details about implementation:
http://stackoverflow.com/questions/15...

So with this implementation when you add marker you need invoke:

pre

markersArray.push(marker);

/pre

And when you need remove all markers you can run following JS:

pre

clearOverlays();

/pre

Regards.


Clear markers from map

Posted: Sat Jan 10, 2015 7:00 pm
by Cristian Hidalgo

Worked like a charm!
Thank you @ Yurii Orishchuk!