DEV Community

Discussion on: Rendering Leaflet clusters fast and dynamically - let's compare 3 methods

Collapse
 
myleftshoe profile image
myleftshoe

Had a look at the leaflet cluster example - do you know why the polygons are a different shape to the bounds of the markers? Is it because it's snapping to the closest enclosing roads?

Collapse
 
agakadela profile image
Aga Kadela

Hi thank you for your comment. Yes Leaflet.markercluster snapped markers. You can change the radius by maxClusterRadius option. According to documentation:
maxClusterRadius: The maximum radius that a cluster will cover from the central marker (in pixels). Default 80. Decreasing will make more, smaller clusters. You can also use a function that accepts the current map zoom and returns the maximum cluster radius in pixels.
Hope it helps

Collapse
 
dmathina profile image
Dominic Mathina

nice article how does this plugin compare to supercluster?

Thread Thread
 
agakadela profile image
Aga Kadela

Thank you, Dominic; sadly, I don't have any experience with supercluster, so I can't tell you any comparison conclusions.