Reputation: 1724
I'm using OpenLayers-3.6.0 in a web application. I have wfs layer as follow:
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
});
I edit this Point layer as follow:
draw = new ol.interaction.Draw({
source: source,
type: 'Point'
});
Now I want to save this layer in server side. In OpenLayers-2 we defined a saveStrategy and then call save method of it. It is shown as follows:
var saveStrategy = new OpenLayers.Strategy.Save();
/*
* change layer's features
*/
saveStratefy.save();
How can I do it in OpenLayers-3.6.0?
Upvotes: 1
Views: 991
Reputation: 2126
This is now up to the application code to handle. The Boundless SDK has some code for this. See: http://boundlessgeo.com/2014/06/openlayers-editing-wfs-t/ and also the code in this repository: https://github.com/boundlessgeo/suite/blob/master/sdk/src/main/resources/client/ol3-common/app/TransactionHandler.js
Upvotes: 1