我正在使用OpenLayers-3.6.0在网络应用程序中。我有 wfs 层如下:
var url="http://localhost:8080/geoserver/wfs?&" +
"service=wfs&version=1.1.0&request=GetFeature&typeNames=usa:states";
var format = new ol.format.WFS({});
var source = new ol.source.Vector({
url: 'proxy.cgi?url='+ encodeURIComponent(url),
format: format
});
layer wfs = new ol.layer.Vector({
title: 'states',
source: source
});
我按如下方式编辑此点图层:
draw = new ol.interaction.Draw({
source: source,
type: 'Point'
});
现在我想将这一层保存在服务器端。在 OpenLayers-2我们定义了一个saveStrategy,然后调用它的save方法。如下所示:
var saveStrategy = new OpenLayers.Strategy.Save();
/*
* change layer's features
*/
saveStratefy.save();
如何在OpenLayers-3.6.0中做到这一点?
最佳答案
现在这由应用程序代码来处理。 Boundless SDK 有一些相关代码。 请参阅:http://boundlessgeo.com/2014/06/openlayers-editing-wfs-t/以及此存储库中的代码:https://github.com/boundlessgeo/suite/blob/master/sdk/src/main/resources/client/ol3-common/app/TransactionHandler.js
关于javascript - 在 OpenLayers 3 中使用 wfs-t?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31562934/