Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cancel cluster expansion event based on condition #1109

Open
1 of 2 tasks
qpary opened this issue Sep 26, 2024 · 1 comment
Open
1 of 2 tasks

Cancel cluster expansion event based on condition #1109

qpary opened this issue Sep 26, 2024 · 1 comment

Comments

@qpary
Copy link

qpary commented Sep 26, 2024

Hi !
Same as Issue 1101 I wanted to cancel the expansion of cluster based on condition.

But it seems like i cannot stop the propagation of the events.
I tried the solution "attach the event handler before any layer is added to L.MarkerClusterGroup" but the cluster keeps expanding. Maybe there is something I dont understand about leaflet layer and event.


How to reproduce

  • Leaflet version I'm using: 1.9.4
  • Leaflet.MarkerCluster version I'm using: 1.4.1
  • Browser (with version) I'm using: Latest firefox
  • OS/Platform (with version) I'm using: Macos

What behaviour I'm expecting and which behaviour I'm seeing

Im expecting the cluster to not open while clicking and another condition (in my example command key). I already logged, I'm entering the condition
Im seing the cluster to expand and the map to zoom

Minimal example reproducing the issue

jsFiddle

  • this example is as simple as possible
  • this example does not rely on any third party code
@qpary
Copy link
Author

qpary commented Sep 27, 2024

I followed the step here https://github.com/Leaflet/Leaflet.markercluster/blob/master/CONTRIBUTING.md to generate the js source file from master. It's not an official version of this plugin, but since I saw a commit related to this issue. I tried my luck and it seems like working as intended and the event is blocked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant