I enabled the functionality to draw Polygons, as in the example. http://dev.openlayers.org/examples/draw-feature.html

Now I want that, once I created a polygon, this polygon is saved as a feature from an underlying WFS layer.

How can I do this?

1 Answer 1


You need to use WFS-T, the T standing for transactional, which is what's required to be able to write-back. Both Openlayers and GeoServer support this.

This question may help on the script side - WFS-T: changes not saved on an OpenLayers map

There's also a sample tutorial here: http://www.gistutor.com/openlayers/22-advanced-openlayers-tutorials/47-openlayers-wfs-t-using-a-geoserver-hosted-postgis-layer.html

  • link broken update answer please
    – Emiliano
    Jun 10, 2018 at 4:53

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.