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

Events not firing

jpdalbertweil opened this issue · comments

Hi,
I'm using geoman.io to draw and edit geofences with react-leaflet.
I create a polygon with multiple eventlistners, inculding "pm:cut".
The problem: after the first cut has been made, no more events are fired.

After each cut a new polygon is created. You need to apply all the listeners to the new layer again.

You get the new layer with the pm:cut event:

polygon.on('pm:cut', (e)=>{
   const newLayer = e.layer;
});

https://geoman.io/docs/modes/cut-mode

Ah makes sense, didn't know that! Thank you for the quick response!