-
Notifications
You must be signed in to change notification settings - Fork 98
Description
Environment details
API: Maps JavaScript API - @googlemaps/markerclusterer
OS: macOS (Apple M3)
Library version: @googlemaps/markerclusterer (2.0.15) with google.maps.marker.AdvancedMarkerElement.
Summary
When using MarkerClusterer with SuperClusterAlgorithm, it appears that multiple AdvancedMarkerElement instances that share the exact same coordinates are being treated as a single point. The resulting cluster icon shows a count of "1" instead of the total number of markers passed for that location.
This behavior is unexpected, as the library should cluster all provided markers. In our application, we have a side panel that lists the total number of entities (which is correct), but the map's visual cluster count is incorrect due to this apparent de-duplication, leading to a confusing user experience.
Steps to reproduce
Initialize a Google Map.
Create an array of multiple google.maps.marker.AdvancedMarkerElement instances, ensuring at least two or more share the exact same latitude and longitude.
Initialize MarkerClusterer using the default SuperClusterAlgorithm.
Call markerClusterer.addMarkers() with the array of markers.
Observe the map. A cluster will form at the specified coordinate, but its count will be "1" instead of the actual number of markers at that location.