react-leaflet-markercluster
react-leaflet-markercluster copied to clipboard
Was onClucterClick removed as an event?
Hello there. I'm trying to do an activity where I click on a cluster and something happens. However, I am unable to trigger it on the cluster. Below an example on codesandbox. Try clicking on the cluster. You will see that nothing happens. Was it removed?
https://codesandbox.io/s/gifted-liskov-9rw91?file=/src/App.js
I think I'm having the same problem, perhaps an issue with v3?
Looks like the storybook examples don't work either unfortunately apart from the onClose
one.
The thing with this component implementation is that createPathComponent needs 2 arguments. The first is the function that called when the component is created, and the second is a function that called when the component is updated. And this implementation defines only the first one.
https://github.com/yuzhva/react-leaflet-markercluster/blob/398a2e16479c2073f286af628e3576268fa5753b/src/react-leaflet-markercluster.js#L7
So if you dynamically add/remove handlers to your component, changes are not applied.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
was also looking for an answer to this but seems i have found a solution, just call onClick not onClusterClick.
this line is causing the clustering event to be called clusterclusterclick, not sure if there was a need to ad this extra text for other use cases or can be removed.