我正在尝试在openlayers中编辑和保存要素。这样做时,我被困在一个要从矢量源获得all修改特征together的地方。有什么解决办法吗?
还建议我如何使用openlayers,geoserver,postgis实现要素审核功能。有解决方案吗?
您必须收听addfeature
removefeature
和changefeature
事件以获取通知并存储功能修改。
source.on ('changefeature', (e) => {
// e.feature has changed
// do something with it...
e.feature._state = 'update';
});
查看WFS-T并用作writeTransaction以将修改发送到服务器(https://openlayers.org/en/latest/apidoc/module-ol_format_WFS-WFS.html)。