geoman-io / leaflet-geoman

🍂🗺️ The most powerful leaflet plugin for drawing and editing geometry layers

Home Page:https://geoman.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add multiple events to the same layer in leaflet geoman

Preefix opened this issue · comments

Hey,

Is it possible to bind Edit/Drag/Rotate functionaility to one button?

I created an example where I added the Drag/Rotate handlers to the Drag button.
I want to fire different events bases on the previous user interaction. This works fine for dragging and rotating. Is there a way to make this work with resizing? I would like to allow the user to resize/drag/rotate a layer when the pm:globaleditmodetoggled is toggled for example.

Thank you for opening the request.

We do not support having multiple modes active on the same time.
However rotation and editing will never work, because both are listening on the verex-handlers. But you could use edit and drag in the same way as rotate and drag. Just replace enableRotation with enable()

https://jsfiddle.net/nsbx0d8f/