Skip to content
Advertisement

Combine Geocode with marker clustering

How to use MarkerCluster with geolocations from a database, displaying markers on the map works fine. but I haven’t been able to implement marker clustering.

Any help would be appreciated

Advertisement

Answer

You are creating a new MarkerCluster every time you create a marker. Create it once, add all the markers to the same MarkerClusterer object.

proof of concept fiddle

code snippet:

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement