How to get edited layer geojson? #1190
-
Hello, I am currently trying to figure out why my layers feature is not being changed after editing some vertices in the map.
After the edit happens, I am printing the new geojson to the console, however it matches exactly what the original geojson is. I am sort of confused why it is not updating the original maps layer's geojson after an edit. I am using typscript as well. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
I am a Geoman noob but I think you need to look at the 'pm.update' (not pm.edit) event which fires after you finish an edit. |
Beta Was this translation helpful? Give feedback.
-
To get the newest data you need to run |
Beta Was this translation helpful? Give feedback.
layer['feature']
will not be updated because this property is set by Leaflet self while executingmyLayer.addData(geojsonObject);
.To get the newest data you need to run
layer.toGeoJSON()