Clearing an entire array of markers using the syntax you quoted doesn't work:
markers.setMap(null); Error: setMap is not a function. The array type has no setMap method, setMap is a method of the google.maps.Marker object... Martin. On Dec 26, 1:43 am, en4ce <djen...@googlemail.com> wrote: > if you want to erase all markers just do it like this: > > markers = the array with your markers > > for (var i in markers) { > markers[i].setMap(null); > } > > markers.setMap(null);should work as well > > -- en4ce > > On Dec 26, 2:34 am, "geocode...@gmail.com" <geocode...@gmail.com> > wrote: > > > On Dec 25, 8:10 pm, Alex Genadinik <alex.genadi...@gmail.com> wrote: > > > > Actually I was able to track the markers and save them into an array. > > > My question was more of how to actually take the marker out of the > > > map? > > > I mean - what is the syntax for taking the marker out of the map? > > > > I think it must be a 1-liner, but I can't quite find the right > > > example. > > > For the v3 API to remove a marker from the map call .setMap(null); on > > the marker. > > > -- Larry > > > > Thanks, > > > Alex -- You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group. To post to this group, send email to google-maps-js-api...@googlegroups.com. To unsubscribe from this group, send email to google-maps-js-api-v3+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.