Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Leaflet Marker Cluster coverage path options

How do I override the options for the Leaflet.markercluster coverage path?

It is using the default style.(The blue shape when the yellow marker cluster button is being hovered).

Or is there a way to disable it on mouseover?

path

like image 295
ddd Avatar asked Oct 29 '25 07:10

ddd


1 Answers

I guess you are using the Leaflet.markercluster plugin, and are asking how to customize the coverage polygon that is displayed when hovering a cluster, or how to disable this feature?

In that case:

  • to disable this feature, use the showCoverageOnHover option:
L.markerClusterGroup({
  showCoverageOnHover: false
});
  • to customize the appearance of the coverage polygon, use the polygonOptions option, with an object containing appropriate path style options:
L.markerClusterGroup({
  polygonOptions: {
    color: "red"
  }
});
like image 72
ghybs Avatar answered Oct 31 '25 00:10

ghybs



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!