Cluster multiple markers together to better visualize the data
This example displays a map showing the distribution of airports across the world. The locations were obtained by using the OpenFlights Airport Database. Instead of adding a marker for each location, the data has been clustered, and individual airports are only shown at higher zoom levels.
Marker clustering requires the presence of the mapsjs-clustering
module of the API.
The H.clustering.Provider
class is used to load in data points and prepare them for clustering.
The result is added to the map as an additional layer using the map.addLayer()
method.