gpt4 book ai didi

javascript - 在 OpenLayers 3 中使用 wfs-t?

转载 作者:行者123 更新时间:2023-11-28 00:03:33 25 4
gpt4 key购买 nike

我正在使用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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com