Reputation: 3
I am trying to Edit and save features in openlayers. While doing so, I got stuck at one place where I want to get all modified features together from vector source. Is there any solution?
Also suggest how can I implement feature audit functionality using openlayers, geoserver, postgis. Any solution available?
Upvotes: 0
Views: 102
Reputation: 1421
You have to listen to addfeature
removefeature
and changefeature
events to get informed and store feature modifications.
source.on ('changefeature', (e) => {
// e.feature has changed
// do something with it...
e.feature._state = 'update';
});
Look at WFS-T and functions as writeTransaction to send modifications to server (https://openlayers.org/en/latest/apidoc/module-ol_format_WFS-WFS.html).
Upvotes: 1