aim
aim

Reputation: 3

openlayers, how to get all modified features together from vector source

  1. 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?

  2. Also suggest how can I implement feature audit functionality using openlayers, geoserver, postgis. Any solution available?

Upvotes: 0

Views: 102

Answers (1)

Viglino Jean-Marc
Viglino Jean-Marc

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

Related Questions