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

Not working drag events: dragstart, drag, dragend, etc. #1318

Closed nchizhov closed 1 year ago

nchizhov commented 1 year ago

Using leaflet-geoman-free: 2.14.2

When try set event listening on map for drag* events - they are not fire.

P.S. On your example site when try to drag - in console browser showing error: Uncaught TypeError: Cannot read properties of undefined (reading 'event') at i.<anonymous> (e0ecda8.js:1:260438) at i.fire (leaflet.js:5:5066) at leaflet-geoman.min.js:1:211746 at Array.forEach (<anonymous>) at Object._fireEvent (leaflet-geoman.min.js:1:211723) at i.__fire (leaflet-geoman.min.js:1:58971) at i._fireEdit (leaflet-geoman.min.js:1:47888) at leaflet-geoman.min.js:1:155735

Falke-Design commented 1 year ago

Hi @nchizhov,

you need to set the event listeners on the layer self and not the map. Also make sure to use the correct ones pm:dragstart, pm:drag, pm:dragend.

Do you mean with example site https://geoman.io/geojson-editor? I can't reproduce it, can you please share a video?

nchizhov commented 1 year ago

Thank you.

Record from site with error: https://www.youtube.com/watch?v=oocBXt-eTpU

Same error showing also in Firefox, Chrome

Falke-Design commented 1 year ago

What browser with which version are you using? I can not reproduce this error :/

nchizhov commented 1 year ago

Now not showing any errors in console.