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

non snapdrag drag event #662

Closed mike16889 closed 3 years ago

mike16889 commented 4 years ago

Is there a drag event? I know there is a snapdrag event, but that does not fire if the user holds alt (to disable snapping) or am I missing a way of binding the leaflet event? I could bind it to the handle markers but that won't give me the edited layer.

Falke-Design commented 4 years ago

@mike16889 Which drag do you mean?

  1. Dragging the whole layer (move tool)
  2. Drawing (follows the mouse)
  3. Drag a vertex marker in edit mode from a layer

1: The event: pm:drag 2: You have to add a listener to the hint marker (every time you start drawing): map.pm.Draw.Line._hintMarker.on('move',(e)=>console.log(e)) 3: You have to listen on the markerdragstart event and then add a listener to the marker if it is draged: https://github.com/geoman-io/leaflet-geoman/issues/660#issuecomment-688109856 But I'm already on it, to add the markerdrag event