googlemaps / googlemaps/js-markerclusterer

Hiding markers is still displaying clusters with size 0

Open
#267 10 comments 3 reactions 0 assignees View on GitHub
triage me type: bug
Dominant language
TypeScript
Stars
293
Forks
104
Avg merge
3m
Merged PRs (30d)
18

Description

Hi,
I'm currently building an interactive map with markers. So my code is adding a map with various markers, then adding a clustering and everything is working fine. Issue is appearing when I'm starting to hide some markers, by using ```marker.setVisible(false)``` and then rendering again my clusterer, with ```markerClusterer.render()```. I can see on my map some cluster with size 0 appearing where I've hidden some markers.

#### Environment details

1.Using script api ` `
2. Inside a vuejs app

#### Steps to reproduce

1. Create a map
2. Add various markers
3. Add a clustrer
4. Render it to see everything is fine
5. Hide markers dynamically, with a button click for example
6. Render again the clusterer

You should see like me clusters of size 0

#### Code example

Rapid fiddle here : https://jsfiddle.net/2vzayxc4/3/
Click on *hide* button under the map, and zoom out to see it happening.

Thanks for the help, it's driving me crazy ;)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.