[OpenLayers-Users] Users Digest, Vol 35, Issue 58
Gabriel Nolasco
nolasco_gabriel at yahoo.com.br
Fri Aug 21 07:11:01 EDT 2009
Hi!
To set the feature attributes use the proprerty 'attributes' from the class 'OpenLayers.Feature.Vector'.
You can control the the transaction type using something like his:
if (selectedFeature.state != OpenLayers.State.INSERT) {
selectedFeature.state = OpenLayers.State.UPDATE;
}
>
> Hi all,
>
> In case that someone is stuck with the same problem that I
> had I attached
> the code that works for me.
>
> By the way, Can anyone point me to some examples using a
> web form to enter
> and modify attributes store in a PostGIS DB via WFS-T?
>
> Thanks for your help!
>
>
> //WFS Layer
>
> wfs3 = new OpenLayers.Layer.WFS(
>
> "Same Water Points",
> "http://localhost:8080/geoserver/wfs",
>
> {typename: 'cite:water_points'},
> {
>
> typename: "water_points",
>
> featureNS: "http://www.opengeospatial.net/cite",
>
> extractAttributes: false,
>
> commitReport: function(str) {
>
> OpenLayers.Console.log(str);
>
> }
> }
> );
>
> var saveStrategy =
> new OpenLayers.Strategy.Save({
> callback: function() {
>
> alert('feature saved');
> }
> });
>
> map.addLayers([wfs3]);
>
>
> //BUTTONS:
>
> var panel = new OpenLayers.Control.Panel({
>
> displayClass: "olControlEditingToolbar"
> });
>
> var draw = new
> OpenLayers.Control.DrawFeature(
>
> wfs3, OpenLayers.Handler.Point,
> {
>
> handlerOptions: {freehand: false, multi:
> true},
>
> displayClass: "olControlDrawFeaturePoint"
> }
> );
>
>
> var modify = new OpenLayers.Control.ModifyFeature(wfs3, {
>
> title: "Modify Feature",
>
> displayClass: "olControlModifyFeature"
>
> });
>
>
> var del = new
> DeleteFeature(wfs3, {title: "Delete Feature"});
>
>
>
>
> var save = new
> OpenLayers.Control.Button({
>
> trigger: OpenLayers.Function.bind(wfs3.commit, wfs3),
>
> displayClass: "olControlEditingToolbar",
>
> title: "Guardar"
> });
>
>
>
>
>
> panel.addControls([
> new
> OpenLayers.Control.Navigation(),
>
> save, del, modify, draw
> ]);
>
>
> map.addControl(panel);
>
____________________________________________________________________________________
Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com
More information about the Users
mailing list