geoman-io / leaflet-geoman

🍂🗺️ The most powerful leaflet plugin for drawing and editing geometry layers
https://geoman.io
MIT License
2.21k stars 433 forks source link

Add multiple events to the same layer in leaflet geoman #1462

Closed Preefix closed 6 months ago

Preefix commented 7 months ago

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.

Falke-Design commented 6 months ago

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/