// the find
Leaflet/Leaflet.markercluster
Marker Clustering plugin for Leaflet
A Leaflet plugin that groups nearby markers into clusters, with animated zoom/uncluster transitions and a spiderfy mode for overlapping pins. It's the de facto standard for Leaflet marker clustering — if you're using Leaflet and have more than a few dozen markers, this is what you reach for. Handles up to 50k markers in modern browsers with chunked loading.
The spiderfy behavior for co-located markers is genuinely well-thought-out — it fans markers into a spiral or line so you can click individual ones without zooming to max. The chunked addLayers option prevents the main thread from locking when loading large datasets; the chunkProgress callback lets you wire up a real progress bar. Custom iconCreateFunction gives you full control over cluster appearance without having to fork anything. The sub-plugin ecosystem (FeatureGroup.SubGroup, LayerSupport) fills the gaps around L.Control.Layers compatibility that the core plugin deliberately skips.
Last commit was August 2024 and the repo has 400+ open issues — it's in maintenance mode at best. No TypeScript types in the package itself; you'll pull in @types/leaflet.markercluster separately and hope they stay in sync. The clustering algorithm is a fixed-radius grid bucketing approach, not a proper geographic algorithm like DBSCAN or H3 — this means cluster shapes are viewport-dependent and can feel arbitrary when the user pans slightly. No built-in support for non-point geometries: if your data has lines or polygons, you're on your own or relying on one of the community sub-plugins.