Google-maps removeMarker not working with enableClustering

I can create a Maps view with a number of markers. Then user specifies some filter through some dialog and I want to remove some of the markers.
I can remove the markers based on the ID they got from the addMarker function. The markers will disappear from current view.
BUT: when I zoom out all the removed markers appear again.
Problem is with both removeMarker() and removeMarkers() function.

Using capacitor 5.5.1 + angular 14.

Turns out this problem only occurs when I use the enableClustering() function.

When I first call disableClustering(), then deleteMarker() and in the end enableClustering() everything seems to work well.

1 Like

If you’re still using this plugin…

I’m unable to removeMarkers as well.

I have tried to disable the clustering, but its not doing anything.
The ID of the marker is removed from the MAP, but the icon itself remains.

Did you do anything else to resolve this?

Thanks

@medida : Yes, still using this plugin.No problem since I found out the disableClustering trick.
Note: don’t forget to put ‘await’ in front of the removeMarker calls.

Hi - Thanks

I’ve finally got it work a little but better - I have changed the ID of the map to be a Unique ID everytime the page loads / map is created.

this works - but now the map does not always display correctly ( panels of the map are overlapping )
When this happens the map cannot be touched etc… although i can remove all the markers!!

This plugin is really frustrating - i would use the capacitor-comunity one but it does not have some of the controls…

It works slightly better which out the ionic livereload. but its still terrible.