Leaflet Clustering.

A quick and relatively easy question about Leaflet. I don't think I need a reproducible example.
I want to understand how clustering works. How does leaflet decide to assign points to a cluster at zoom levels? I can't find anything to describe how it does what it does...

The assigning of markers to clusters does not really happen at the R side of a leaflet map, but on the javascript side; all that {leaflet} does is "only" passing the options.

You will find some documentation on https://github.com/Leaflet/Leaflet.markercluster#defaults - the interesting part seems to happen at maxClusterRadius - this defaults to 80 pixels, with option to override. So you should - in theory - be able to achieve smaller (denser) clusters or larger (more sparse) ones by tweaking this parameter.

This is really helpful. Thanks, let me look at this.

Let me know what happens - I have never tried tweaking this, the default seems to "just work" for me. But now I am curious about the outcome...

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.