Events not firing
jpdalbertweil opened this issue · comments
jpdalbertweil commented
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.
Florian Bischof commented
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;
});
jpdalbertweil commented
Ah makes sense, didn't know that! Thank you for the quick response!