Marker Clusterer Plus change icon on hover

Viewed 4900

How can I dynamically change the Icon used for a specific Cluster in Marker Clusterer Plus for Google Maps V3?

The markers do not seem to expose any methods at all to modify them. I need to do something like this (or equivalent).

google.maps.event.addListener(markerCluster, "mouseover", function (cluster) {
  cluster.setIcon(hoverIcon);
});
google.maps.event.addListener(markerCluster, "mouseout", function (cluster) {
  cluster.setIcon(normalIcon);
});
3 Answers

There is some changing in last google maps.

    google.maps.event.addListener(markerCluster, 'clusterclick', function(cluster) {
    cluster.clusterIcon_.div_.style.backgroundImage = 'url("linktoyourimage")'})

Image icon moved to background.

for me the following path worked: cluster.clusterIcon.div.firstChild.src

Related