MarkerClusterer with AdvancedMarkers #3349
Replies: 4 comments 4 replies
-
I never worked with MarkerCluster, but would also be interested to see how it works. |
Beta Was this translation helpful? Give feedback.
-
I got the MarkerClusterer to work in our project with AdvancedMarkers. Downside is that this Clusterer doesn't work with old markers. Basically I just copied the MarkerClusterer, Clusterer, Cluster and ClusterIcon files from this project and fixed the things that had changed with AdvancedMarkers. I did some other small changes that I believe reduce rendering in some cases. Anyways, to get this to work, you need to just add these components to your own project (just like with @Fabioni 's AdvancedMarker) and fix the import paths to match your directory structure.
Clusterer.jsx
Cluster.jsx
ClusterIcon.jsx
|
Beta Was this translation helpful? Give feedback.
-
If anyone can help me set up this project locally, I can create AdvancedMarker and cluster things. |
Beta Was this translation helpful? Give feedback.
-
I am not too happy with the performance of my MarkerClusterer, not that the original one worked too well either. I tried to fix it a bit and at the same time simplified usage a bit. Now markers can be just added as children of the MarkerClusterer without the render function:
NEW:
This required some changes to the MarkerClusterer and AdvancedMarker
And here is new code for AdvancedMarker, The only real change is getting the clusterer from map instead of props and getting the map zoomLvl from props, zoomLvl is not needed when not using the MarkerClusterer.:
|
Beta Was this translation helpful? Give feedback.
-
Hi,
Anyone got a working implementation of the MarkerClusterer with AdvancedMarkers. Looking at you @Fabioni :)
Beta Was this translation helpful? Give feedback.
All reactions