Skip to content

pm:cut - how can I get the resulting geojson after a cut operation #1535

Closed Answered by Falke-Design
udos asked this question in Questions & Help
Discussion options

You must be logged in to vote

It is important to understand that Leaflet doesn't work with FeatureCollections. Leaflet has Layers which can be in mutliple LayerGroups and on the map.
When you are adding your FeatureCollection to the map with L.GeoJSON, Leaflet converts the FeatureCollection to a LayerGroup and each Feature to a Layer. But for Geoman it doesn't matter if it is in a LayerGroup, only the edited Layer will be changed and for actions like cutting a new Layer is created. It is now your job, to add this new created Layer after cutting to a LayerGroup if you want to generate a FeatureCollection out of it.
To short this up: You need to add the result layer from cutting to the initial L.GeoJSON-LayerGroup and t…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@Falke-Design
Comment options

Answer selected by udos
@udos
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants