<div dir="ltr">hi 
van den Broecke  , even by making this correction the transaction is not carried out towards the database<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le dim. 25 sept. 2022 à 12:28, <<a href="mailto:mapserver-users-request@lists.osgeo.org">mapserver-users-request@lists.osgeo.org</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Send MapServer-users mailing list submissions to<br>
        <a href="mailto:mapserver-users@lists.osgeo.org" target="_blank">mapserver-users@lists.osgeo.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
        <a href="https://lists.osgeo.org/mailman/listinfo/mapserver-users" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
or, via email, send a message with subject or body 'help' to<br>
        <a href="mailto:mapserver-users-request@lists.osgeo.org" target="_blank">mapserver-users-request@lists.osgeo.org</a><br>
<br>
You can reach the person managing the list at<br>
        <a href="mailto:mapserver-users-owner@lists.osgeo.org" target="_blank">mapserver-users-owner@lists.osgeo.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of MapServer-users digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
   1. Re: asking help (Just van den Broecke)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Sun, 25 Sep 2022 01:35:04 +0200<br>
From: Just van den Broecke <<a href="mailto:justb4@gmail.com" target="_blank">justb4@gmail.com</a>><br>
To: <a href="mailto:mapserver-users@lists.osgeo.org" target="_blank">mapserver-users@lists.osgeo.org</a><br>
Subject: Re: [MapServer-users] asking help<br>
Message-ID:<br>
        <CAC8+mc2pMuvpgNg=Y=<a href="mailto:9hyQJ9gq6CFcThKWegi4g8cAbC3ZhecA@mail.gmail.com" target="_blank">9hyQJ9gq6CFcThKWegi4g8cAbC3ZhecA@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
switch(mode) {<br>
                case 'insert':<br>
                    mode = formatWFS.writeTransaction([f], null, null,<br>
formatGML);<br>
                    break;<br>
                case 'update':<br>
                    node = formatWFS.writeTransaction(null, [f], null,<br>
formatGML);<br>
<br>
First case: 'mode =' should be 'node ='<br>
<br>
On Sun, Sep 25, 2022, 00:26 Boubacar Bah <<a href="mailto:bahbouba.909@gmail.com" target="_blank">bahbouba.909@gmail.com</a>> wrote:<br>
<br>
> hello, i need your help regarding tinyows wfs transaction.<br>
> by the way I put in an online editing application.<br>
> in which I used the wfs transaction to send the request to my postgis<br>
> database.<br>
> but the problem is that if I edit an entity in the application the<br>
> transaction does not run to my database.<br>
> So I don't know where the problem is in my code.<br>
> Any help will be welcome.<br>
> Below is the code for the program in question:<br>
> <!DOCTYPE html><br>
> <html><br>
>     <head><br>
>         <title>WFS - GetFeature</title><br>
>         <meta charset="utf-8"/><br>
>         <link rel="stylesheet" href="<br>
> <a href="https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.15.1/css/ol.css" rel="noreferrer" target="_blank">https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.15.1/css/ol.css</a><br>
> " type="text/css"><br>
>         <style><br>
>           .map {<br>
>             height: 400px;<br>
>             width: 100%;<br>
>           }<br>
>         </style><br>
>         <script src="<br>
> <a href="https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.15.1/build/ol.js" rel="noreferrer" target="_blank">https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.15.1/build/ol.js</a><br>
> "></script><br>
>     </head><br>
>     <body><br>
>         <div id="map" class="map"></div><br>
>         <label >Modifier &nbsp;</label><br>
>         <button name="modifier" id="mod" value="Edit"></button><br>
>         <label >Creer &nbsp;</label><br>
>         <button name="Creer" id="creer" value="creer"></button><br>
>         <label >Stop Edition &nbsp;</label><br>
>         <button name="stop_modif" id="stop_mod" value="stop_Edit"></button<br>
> ><br>
>         <script><br>
>           var draw, modify, snap;<br>
>           var maprojection= new ol.proj.Projection({<br>
>             code:'EPSG:4326',<br>
>             extent:[-20,30,20,50],<br>
>             units:'degrees',<br>
>             axisOrientation:'enu'<br>
>           });<br>
>           //surcharge de la projection EPSG:4326<br>
>           ol.proj.addEquivalentProjections([ol.proj.get('EPSG:4326'),<br>
> maprojection]);<br>
>           var wfsSource = new ol.source.Vector({<br>
>             format: new ol.format.GeoJSON(),<br>
>             url: function(extent) {<br>
>                 return '<a href="http://127.0.0.1/cgi-bin/tinyows.exe?service=WFS&" rel="noreferrer" target="_blank">http://127.0.0.1/cgi-bin/tinyows.exe?service=WFS&</a>'<br>
> +<br>
><br>
> 'version=1.1.0&request=GetFeature&typename=tows:demo_tyny&'+<br>
>                 'outputFormat=application/json&srsname=EPSG:4326&'+<br>
>                 'bbox='+ extent.join(',')+',EPSG:4326';<br>
>             },<br>
>             strategy: ol.loadingstrategy.bbox,<br>
>             projection: maprojection<br>
><br>
>           });<br>
>           var vector = new ol.layer.Vector({<br>
>             source: wfsSource,<br>
>             style: new ol.style.Style({<br>
>                 stroke: new ol.style.Stroke({<br>
>                     color: 'rgba(0,0,255,1.0)',<br>
>                     width:4<br>
>                 })<br>
>             })<br>
>           });<br>
>           var map = new ol.Map({<br>
>             layers:[vector],<br>
>             target: document.getElementById('map'),<br>
>             view: new ol.View({<br>
>                 projection: maprojection,<br>
>                 center: [2.5,46],<br>
>                 maxZoom: 20,<br>
>                 zoom: 1<br>
>             })<br>
>           });<br>
>           var etat_edition= document.getElementById('mod');<br>
>           var etat_creation= document.getElementById('creer');<br>
>           var stop_edition= document.getElementById('stop_mod');<br>
>           var draw, snap, modify; //declarees globalement pour les<br>
> activers ou non a la guise<br>
>           var formatWFS = new ol.format.WFS();<br>
>           var xs = new XMLSerializer();<br>
>           var formatGML =  new ol.format.GML3({<br>
>             version:'1.1.0',<br>
>             featureNS: '<a href="http://www.mapserver.org/tinyows" rel="noreferrer" target="_blank">http://www.mapserver.org/tinyows</a>',<br>
>             url: '<a href="http://127.0.0.1/cgi-bin/tinyows.exe" rel="noreferrer" target="_blank">http://127.0.0.1/cgi-bin/tinyows.exe</a>',<br>
>             featureType:'demo_tyny',<br>
>             srsName:'EPSG:4326',<br>
>             geometryName: 'geom',<br>
>             SchemaLocation:'<br>
> <a href="http://127.0.0.1/cgi-bin/tinyows.exe?service=wfs&request=DescribeFeatureType&version=1.1.0&typename=tows:demo_tyny" rel="noreferrer" target="_blank">http://127.0.0.1/cgi-bin/tinyows.exe?service=wfs&request=DescribeFeatureType&version=1.1.0&typename=tows:demo_tyny</a><br>
> '<br>
>           });<br>
>           var transactWFS = function (mode, f) {<br>
>             var node;<br>
>             switch(mode) {<br>
>                 case 'insert':<br>
>                     mode = formatWFS.writeTransaction([f], null, null,<br>
> formatGML);<br>
>                     break;<br>
>                 case 'update':<br>
>                     node = formatWFS.writeTransaction(null, [f], null,<br>
> formatGML);<br>
>                     break;<br>
>                 case 'delete':<br>
>                     node = formatWFS.writeTransaction(null, null, [f],<br>
> formatGML);<br>
>                     break;<br>
>             }<br>
>             var xml_data = xs.serializeToString(node);<br>
>             fetch('<a href="http://localhost/cgi-bin/tinyows.exe?service=wfs" rel="noreferrer" target="_blank">http://localhost/cgi-bin/tinyows.exe?service=wfs</a>', {<br>
>                 method:'POST',<br>
>                 body: xml_data<br>
>             }).then(function() {<br>
>                 wfsSource.clear();<br>
>             })<br>
>           };<br>
>           function add_snap() {<br>
>             snap = new ol.interaction.Snap({source: vector.getSource()});<br>
>             map.addInteraction(snap);<br>
>           }<br>
>           function add_modify(){<br>
>             stopInteractions();<br>
>             add_snap();<br>
>             modify = new ol.interaction.Modify({source: vector.getSource<br>
> ()});<br>
>             map.addInteraction(modify)<br>
>           }<br>
>           function add_creer(){<br>
>             stopInteractions();<br>
>             add_snap();<br>
>             draw = new ol.interaction.Draw({<br>
>                 source: vector.getSource(),<br>
>                 type:"MultiPolygon",<br>
>                 geometryName:'geom'<br>
>             });<br>
>             draw.on('drawend', function(e){<br>
>                 code_saisi=prompt("code_commune");<br>
>                 e.feature.setProperties({'code_commune':code_saisi});<br>
>                 transactWFS('insert',e.feature);<br>
>             });<br>
>             map.addInteraction(draw);<br>
>           }<br>
>           function stopInteractions() {<br>
>             map.removeInteraction(draw);<br>
>             map.removeInteraction(snap);<br>
>             map.removeInteraction(modify)<br>
><br>
>           }<br>
>           etat_edition.onclick = function() {<br>
>             add_modify();<br>
>           };<br>
>           etat_creation.onclick = function() {<br>
>             add_creer();<br>
>           };<br>
>           stop_edition.onclick = function () {<br>
>             stopInteractions();<br>
>           };<br>
><br>
>         </script><br>
>     </body><br>
> </html><br>
> _______________________________________________<br>
> MapServer-users mailing list<br>
> <a href="mailto:MapServer-users@lists.osgeo.org" target="_blank">MapServer-users@lists.osgeo.org</a><br>
> <a href="https://lists.osgeo.org/mailman/listinfo/mapserver-users" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
><br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.osgeo.org/pipermail/mapserver-users/attachments/20220925/2869323d/attachment.htm" rel="noreferrer" target="_blank">http://lists.osgeo.org/pipermail/mapserver-users/attachments/20220925/2869323d/attachment.htm</a>><br>
<br>
------------------------------<br>
<br>
Subject: Digest Footer<br>
<br>
_______________________________________________<br>
MapServer-users mailing list<br>
<a href="mailto:MapServer-users@lists.osgeo.org" target="_blank">MapServer-users@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/mapserver-users" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
<br>
<br>
------------------------------<br>
<br>
End of MapServer-users Digest, Vol 176, Issue 14<br>
************************************************<br>
</blockquote></div>