Skip to content

MarkerClusterer with SuperClusterAlgorithm appears to de-duplicate markers with identical coordinates #1024

@kanwal-rimsha

Description

@kanwal-rimsha

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    triage meI really want to be triaged.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions