Closed
Description
I'm not sure if it's intentional but the pm:cut
event is raised before the layers are updated with the cut on the map.
You can see the behaviour in this fiddle.
When you cut the layer the first console entry shows the state of the map's layers then a second later the updated layers are logged.
If this is intended, perhaps we need a pm:cutend
event that is raised once the cut is applied?
Right now it's not possible to use an event hook to perform operations (such as toGeoJSON()
on the resulting cut geometry) without using a brittle setTimeout()
type workaround.
Happy to raise a PR once it's clear which way round it should be 👍