[OpenLayers-Users] How to insert that I digitized Feture in my WFS layer?

ironbar joki_frei at yahoo.com
Wed Nov 19 11:02:48 EST 2008


I am working with the example vector formats example
(http://openlayers.org/dev/examples/)
I created my own wfs layer to which I would like add feature (polygon, line)
that I digitize on the viewer.
Now I want to keep most of the script of vector formats example example -
that is why I want to create function that will create wfs transaction that
is it will perform wfs insert operation to the layer that I have already
created.
So I need function that will perfrom wfs Insert transaction
Something like this:

function wfs_insrt(feature, wfsl)
{
var wff= new OpenLayers.Format.WFS({layerName:'topp:mywfs'},wfsl);
				
feature.state = OpenLayers.State.INSERT;

wff.insert(feature);

}

So input parameters are the feature and wfs layer and output should be
executed wfs insert transaction.

Thanks in advance 

ironbar wrote:
> 
> Dear all,
> Here is a snippet of my code:
> 
> 
> var wfsl= new OpenLayers.Layer.WFS( "MY WFS",
> 			                    "http://localhost/geoserver/wfs?",
> 			                    {typename: 'topp:mywfs'},
>                                                        { typename:
> 'topp:mywfs'  });
> 
>           
> var wff= new OpenLayers.Format.WFS({layerName:'topp:mywfs'},wfsl);
> 				
> feature.state = OpenLayers.State.INSERT;
> 
> wff.insert(feature);
> 
> I simply want to insert the feature in my wfs layer but what I get is
> "An attempt was made to create or change an object in a way which is
> incorrect with regard to namespaces" code: 14"
> I would like simply to find a way how to perform wfs transactions using an
> imported wfs layer and feature that I created using openlayers example
> "vector-formats".
> Thank you 
> 
> 

-- 
View this message in context: http://n2.nabble.com/How-to-insert-that-I-digitized-Feture-in-my-WFS-layer--tp1518519p1519571.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.




More information about the Users mailing list