2

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?

asked Jul 22, 2015 at 12:14
0

2 Answers 2

6

Have a look at my blog for a bit on WFS-T. This uses the OL 3.5 library.

https://medium.com/@goldrydigital/wfs-t-with-openlayers-3-16-6fb6a820ac58

answered Jul 27, 2015 at 14:13
2
1

I don't need it everyday so I didn't reuse it recently but you can look at https://github.com/boundlessgeo/suite/tree/master/sdk/src/main/resources/client

It's the place where the code for OpenLayers 3 templates in OpenGeo Suite is. One of these templates is for using WFS-T. You have to look at ol3edit and also ol3-common. You will need to analyse JavaScript code as they (Boundless, the company behind) made a custom component for this purpose.

answered Jul 22, 2015 at 16:29
1
  • The link is now 404. Is it possible someone with the knowledge of where it pointed to could update it? Commented Oct 24, 2018 at 21:11

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.