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.

Code

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.