1

I have a web page built with the QGIS webappbuilder by Boundless and the WFS-T widget. Right now, the comments say that it only currently supports geometry updates. I wanted to know if it would be possible to support properties (attribute) updates (i.e., non-spatial data in other columns).

Here is the code for the drawing:

{
key: '_onDrawEnd',
value: function _onDrawEnd(evt) {
  var wfsInfo = this._layer.get('wfsInfo');
  var feature = evt.feature;
  var node = this._format.writeTransaction([feature], null, null, {
    gmlOptions: {
      srsName: this.props.map.getView().getProjection().getCode()
    },
    featureNS: wfsInfo.featureNS,
    featureType: wfsInfo.featureType
  });
  this._doPOST(this._serializer.serializeToString(node), function (xmlhttp) {
    var data = xmlhttp.responseText;
    var result = this._readResponse(data);
    if (result) {
      var insertId = result.insertIds[0];
      if (insertId == 'new0') {
        // reload data if we're dealing with a shapefile store
        this._layer.getSource().clear();
      } else {
        feature.setId(insertId);
      }
    }

I have tried to add a properties argument in the writeTransaction line but I don't think I have the right syntax. After digging through other forums and the OL3 API, I came across the setproperties command in the API. Is it possible for a form to be generated with the OL library to update attributes as well with the setProperties command?

I saw similar post here: How do I set attributes when creating vectors using OpenLayers and WFS-T?

But it didn't seem to approach my end goal of having the user on the client end to input data as a form built from a GeoServer WFS request.

Another issue that I've been running across is that a lot of fixes involve using OL2, not OL3.

  • also, I've seen this link referenced a lot: dev4.mapgears.com/bdga/bdgaWFS-T.html# Is there a working version of this anywhere? – GIS87 Dec 23 '16 at 23:17
  • The underlying SDK of Web App Builder supports this already, but I just noticed WAB does not provide this as an option on the widget. Ticketed as: github.com/boundlessgeo/qgis-webappbuilder-plugin/issues/192 – bartvde Jan 2 '17 at 10:05
  • @GIS87 fyi the bdgaWFS-T example was using the OL2 API. – Alexandre Dubé Jan 2 '17 at 13:24
  • Thanks for the feedback. @bartvde, I noticed that the "Edit" widget on the Boundless web app builder does all of the form editing very well, except that it is not able to use that functionality with WFST layers. Would it be possible to add wfst layers to the edit widget, since I noticed it also supports snapping and other functionalities? I've seen on the github issues page a 2015 question on merging the wfst and edit components (github.com/boundlessgeo/qgis-webappbuilder-plugin/issues/104). – GIS87 Jan 2 '17 at 14:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.