react-leaflet-markercluster icon indicating copy to clipboard operation
react-leaflet-markercluster copied to clipboard

Was onClucterClick removed as an event?

Open GeorgeCodeHub opened this issue 3 years ago • 5 comments

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

GeorgeCodeHub avatar Apr 13 '21 12:04 GeorgeCodeHub

I think I'm having the same problem, perhaps an issue with v3?

charlesomer avatar May 08 '21 13:05 charlesomer

Looks like the storybook examples don't work either unfortunately apart from the onClose one.

charlesomer avatar May 08 '21 13:05 charlesomer

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.

politzekv1 avatar May 31 '21 19:05 politzekv1

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.

stale[bot] avatar Jun 30 '21 21:06 stale[bot]

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.

lgrayland avatar Nov 29 '21 08:11 lgrayland