[OpenLayers-Users] Feature attribute editing/updating

Dave Potts dave.potts at pinan.co.uk
Sun Oct 30 15:48:33 EDT 2011


Hi

I am trying to update an attribute that is loaded from a postgis
database via geoserver as a WFS feature.

I looked at the source code for ModifyFeature, and the example
http://openlayers.org/dev/examples/wfs-protocol-transactions.js.

>From what I have seen from the docs for ModifyfFeature and the source
code it suggests that I should change the modified property in the
VectorFeature object using something like

vf.modified = OpenLayers.Util.extend(features.modified,{ foo: bar})

Where foo is the property name and bar is the new value for this given
property.

The example program just suggest that I should change the value of the
state property on the vectorFeature object to OpenLayers.State.UPDATE
and the create an event.

I am unsure which is the correct way of doing this and if I need to
invoke any callbacks.

So my question is this

How do I record the fact in a given vectorFeature that the value of the
property who name is stored in the varible foo has change its value to
bar, in such a way that the next  save call to stratgy will force an update?

regards


Dave.


More information about the Users mailing list