Skip to content

Cancel cluster expansion event based on condition #1109

@qpary

Description

@qpary

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions