[OpenLayers-Users] WFS-T

Alexandre Dube adube at mapgears.com
Wed Nov 25 09:25:14 EST 2009


Hi,

  Just before your commit, you need to copy the your field values to the 
feature's attributes.  They will then be part of the 'insert' request 
sent to your server.  See an example (demo) of what I'm talking about 
[1].  It uses TinyOWS, but it should be similar to what you're seeking 
to do.

  Hope this helps,

Alexandre


[1] http://dev4.mapgears.com/bdga/bdgaWFS-T.html


JuKiM wrote:
> Hi,
>
> I'm searching documentation about WFS-T, because with I can 
> understand, it let to create new entries in the datastore through the 
> GeoServer....
>
> I create the map, and a wms layers which is displayed, and then I 
> create the wfs layer..
>
> wfs = new 
> OpenLayers.Layer.WFS("Test_Layer","http://localhost:8080/geoserver/wfs",
>                 {typename: 'Test:dots'},
>                 {
>                     typename: "dots",
>                     featureNS: "http://www.uriURL.org/test",
>                     extractAttributes: false,
>                     commitReport: function(str) {
>                      alert(str);
>                         OpenLayers.Console.log(str);
>                     }
>                 }
>             );
>
> var draw = new OpenLayers.Control.DrawFeature(
>                 wfs, OpenLayers.Handler.Point,
>                 {
>                     handlerOptions: {freehand: false, multi: true},
>                     displayClass: "olControlDrawFeaturePoint"
>                 }
>             );
>             
>             var save = new OpenLayers.Control.Button({
>                 trigger: OpenLayers.Function.bind(wfs.commit, wfs),
>                 displayClass: "olControlSaveFeatures"
>             });
>            
>             panel.addControls([
>                 new OpenLayers.Control.Navigation(),
>                 save, draw
>             ]);
>  
>             map.addControl(panel);
>
> When I save the new points, they are insterted in the DB, but with 
> empty values.. Only the auto incremental id is created..
> In my table there are four fields, 'id', 'location', 'description', 
> 'type'. How can I configure the WFS calls to create the new entries 
> with all the information? (The information about description and type 
> is the same, and is stored in a textfield, and the location should be 
> the different points of the map..
>
> And on the other hand, if the datasource contains about 40.000 
> positions, is better to work with WMS and process the information in 
> server side?
>
> Thanks!
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>   


-- 
Alexandre Dubé
Mapgears
www.mapgears.com




More information about the Users mailing list