Basically, when you use a clusterer, it stores all markers.
When you zoom out, it sets their map to
null
and adds cluster pics.When you zoom in, it removes the cluster pic and sets the map again in the markers.
So when you do marker.setMap(null)
, it's not enough: you have to remove the markers from the clusterer too!
_.each markers, (marker, i) ->
marker.setMap(null)
handler.clusterer.removeMarker(marker)
But I also needed this scenario, so just do:
_.each markers, (marker, i) ->
handler.removeMarker(marker)
Or even:
handler.removeMarkers(markers)