Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Leaflet.js Essentials

You're reading from   Leaflet.js Essentials Create interactive, mobile-friendly mapping applications using the incredibly light yet powerful Leaflet.js platform.

Arrow left icon
Product type Paperback
Published in Aug 2014
Publisher
ISBN-13 9781783554812
Length 180 pages
Edition 1st Edition
Languages
Arrow right icon
Toc

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

You can download this plugin at https://github.com/Leaflet/Leaflet.markercluster.

Coding your first cluster map

A marker cluster is just another example of a layer in Leaflet. So, creating one should look very familiar to you. You need to perform the following...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image