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

Alexandre Dube adube at mapgears.com
Wed Nov 19 09:55:48 EST 2008


Anybody correct me if I'm wrong :

The example uses the Save Strategy to do so.  When the user draws a 
feature, its state becomes "insert" or something like that.  When a 
already present features gets modified, its state becomes "update" or 
something like that.

And there's a button that, on click, triggers the save() function of the 
Save Strategy, check every features of the layer and generate a GML POST 
INSERT request for new features and GML POST UPDATE request for modifed 
features... 

Well, I'll stick with my first suggestion anyway, you should get this 
svn version on to your local platform and try it.  You'll be able to see 
step by step how it works.

Do you use firefox ?  If so, do you know firebug ?  As I already read 
from the list before, firebug is a great javascript teacher !

Best luck to you,

Alexandre

ironbar wrote:
> I have been reading this example for some time but still I cannot figure out
> where is the part (line) where a created featur get inserted in a wfs layer.
>
> Alexandre Dube wrote:
>   
>> Well, I don't know any other way if there are.  Maybe someone else could 
>> help you for that matter.
>>
>> But, you should take some time to read the whole example and try it.  
>> You would discover a not so hard way to use WFS-Transactions.
>>
>> Cheers,
>>
>> Alexandre
>>
>> ironbar wrote:
>>     
>>> Thanks for the answer: I saw the wfs transaction example that you
>>> mentioned
>>> but still I can not figure out the connection between a created feature
>>> and
>>> a wfs layer in which I want to insert my feature. I simply would like to
>>> see
>>> what is the simplest code for inserting a feature to a wfs layer. That is
>>> why I posted the snippet that I thought is the simplest way for
>>> implementing
>>> a wfs transaction.
>>> I hope that there is a simpler way to perform wfs transactions than as it
>>> is
>>> given in mentioned example.
>>>
>>> Alexandre Dube wrote:
>>>   
>>>       
>>>> Hi,
>>>>
>>>>   Check out the WFS-T example in this sandbox to see a way of doing it 
>>>> with the WFS protocol : 
>>>> http://svn.openlayers.org/sandbox/topp/wfs/examples/wfs-protocol-transactions.html
>>>>
>>>>   Download this svn version and try it.  Hope this helps.
>>>>
>>>> Best regards,
>>>>
>>>> Alexandre
>>>>
>>>>
>>>> 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 
>>>>>
>>>>>   
>>>>>       
>>>>>           
>>>> -- 
>>>> Alexandre Dubé
>>>> Mapgears
>>>> www.mapgears.com
>>>>
>>>> _______________________________________________
>>>> Users mailing list
>>>> Users at openlayers.org
>>>> http://openlayers.org/mailman/listinfo/users
>>>>
>>>>
>>>>     
>>>>         
>>>   
>>>       
>> -- 
>> Alexandre Dubé
>> Mapgears
>> www.mapgears.com
>>
>> _______________________________________________
>> 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