Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maps JavaScript API: Unable to hide AdvancedMarkerElement when used with MarkerClusterer #961

Open
ffordian opened this issue Feb 21, 2025 · 0 comments
Labels
triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@ffordian
Copy link

ffordian commented Feb 21, 2025

I'm using AdvancedMarkerElements together with MarkerClusterer to display approximately 75 business locations on a map. Users can filter business locations by service type and state, and markers that do not meet filter conditions should be hidden.

To hide markers, I'm setting marker.map = null, as per the documentation. This works fine when displaying markers without a MarkerClusterer. However, with a MarkerClusterer the markers are initially hidden but reappear when the user scrolls or zooms the map.

I'm using Maps API version 3.60.1.

Steps to reproduce

  1. See example code at https://jsfiddle.net/asthmaticcanary/u6qo31ds/24/
  2. Add valid API key.
  3. Click button to hide some markers by setting marker.map = null.
  4. Scroll or zoom map and note that hidden markers reappear.

This is possibly related to #867 but I think is a unique issue as it impacts basic location filtering functionality.

@ffordian ffordian added triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

1 participant