pm:cut - how can I get the resulting geojson after a cut operation #1535
-
hi, I'm struggling with getting the resulting geojson after a cut operation. let me explain:
so far I was unable to access the resulting featurecollection :| any ideas/suggestion? thanks 🙏 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hi,
|
Beta Was this translation helpful? Give feedback.
-
thx. I added numbers to my original question to better explain. yes, for the "impacted" linestring of the original featurecollection (point 1.) which is now 2 I can do that (in point 4.). but how can I get to the geojson of the changed featurecollection which now has 9 linestrings? |
Beta Was this translation helpful? Give feedback.
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…