These bounds_changed
-events will be bound to the map when a ClusterIcon
will be added(happens all the time when you call markerClusters[n][sc].setMap(map)
).
When you call markerClusters[n][sc].setMap(null)
the ClusterIcons will be removed, the onRemove-method also clears all listeners bound to the ClusterIcon
-instances, but the onRemove-method does not remove the bounds_changed
-events bound to the map(you may call it a bug).
So you may either fix the bug on your own and modify the markerclusterer.js so that it also removes the bounds_changed-event, or don't call setMap()
at all, instead you may e.g. call the methods show()
or hide()
of the ClusterIcon
-instances to show or hide them(should give a better performance).