1
votes

I'm trying to change the color of the coverage on hover (showCoverageOnHover) in the Leaflet markercluster plugin. I can't find this in the documentation.

What I want to achieve is to change the color of the coverage on hover from blue to something else. For example, when you hover with the mouse over a cluster icon in this example.

2
Is there a solution for this? I would be interested, too. - Magda
Seb, did any of the answers help? If so, please accept one, to help others who read the question in future, just as you have been helped. If answers do not help, a comment explaining why usually elicits an expanded answer. - Mawg says reinstate Monica

2 Answers

2
votes

OK, using polygonOptions is the right answer, like that:

var markers = L.markerClusterGroup({

    polygonOptions: {
        fillColor: '#1b2557',
        color: '#1b2557',
        weight: 0.5,
        opacity: 1,
        fillOpacity: 0.5
        }
});
1
votes

Quoting from the docs:

polygonOptions: Options to pass when creating the L.Polygon(points, options) to show the bounds of a cluster. Defaults to empty, which lets Leaflet use the default Path options.