Cristian Hidalgo
Posts: 0
Joined: Mon Nov 03, 2014 2:38 pm

Clear markers from map

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

Cristian Hidalgo
Posts: 0
Joined: Mon Nov 03, 2014 2:38 pm

Clear markers from map

Any help is appreciated....

Image

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Clear markers from map

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.

Cristian Hidalgo
Posts: 0
Joined: Mon Nov 03, 2014 2:38 pm

Clear markers from map

Worked like a charm!
Thank you @ Yurii Orishchuk!

Return to “Issues”