Open
Description
Describe the bug
The geoman plugin allows users to add event handlers to newly created layers. After a making a cut using the scissor tool, these event handlers are lost.
To Reproduce
m = folium.Map(
location=[40.73, -73.94],
zoom_start=12,
)
click = JsCode("""
(e) => {
console.log(e.target.toGeoJSON());
}
"""
)
gm = GeoMan(
on={
"click": click,
}
).add_to(m)
Expected behavior
I expect the event handlers to still exist after cutting.
Additional context
On the Geoman forum, I discovered that the "cut" action creates a new layer object. Easiest would be to add the event handler also on the "pm:cut" event.
Metadata
Metadata
Assignees
Labels
No labels