Clustering markers with Leaflet.markercluster

As you create more maps, you will eventually run in to a dataset that is thousands of points. Displaying 10,000 points on a map results in a slow load time, lagging animation on zooming and panning, and makes it hard for the user to select a single marker or to make sense of the data. Clustering allows you to group markers into clusters—single points that expand as the zoom level increases. This way, you can get a sense of the magnitude of data without being visually overwhelmed by the sheer number of points. If you need to see a single point, you can zoom in to the region or point of interest. Leaflet.markercluster is a fast and powerful cluster implementation that is also visually appealing.

Note ...

Get Leaflet.js Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.