<div dir="ltr">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 database.<br>but the problem is that if I edit an entity in the application the 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><div><div style="color:rgb(212,212,212);background-color:rgb(30,30,30);font-family:Consolas,"Courier New",monospace;font-size:14px;line-height:19px;white-space:pre"><div><span style="color:rgb(128,128,128)"><!</span><span style="color:rgb(86,156,214)">DOCTYPE</span> <span style="color:rgb(156,220,254)">html</span><span style="color:rgb(128,128,128)">></span></div><div><span style="color:rgb(128,128,128)"><</span><span style="color:rgb(86,156,214)">html</span><span style="color:rgb(128,128,128)">></span></div><div>    <span style="color:rgb(128,128,128)"><</span><span style="color:rgb(86,156,214)">head</span><span style="color:rgb(128,128,128)">></span></div><div>        <span style="color:rgb(128,128,128)"><</span><span style="color:rgb(86,156,214)">title</span><span style="color:rgb(128,128,128)">></span>WFS - GetFeature<span style="color:rgb(128,128,128)"></</span><span style="color:rgb(86,156,214)">title</span><span style="color:rgb(128,128,128)">></span></div><div>        <span style="color:rgb(128,128,128)"><</span><span style="color:rgb(86,156,214)">meta</span> <span style="color:rgb(156,220,254)">charset</span>=<span style="color:rgb(206,145,120)">"utf-8"</span><span style="color:rgb(128,128,128)">/></span></div><div>        <span style="color:rgb(128,128,128)"><</span><span style="color:rgb(86,156,214)">link</span> <span style="color:rgb(156,220,254)">rel</span>=<span style="color:rgb(206,145,120)">"stylesheet"</span> <span style="color:rgb(156,220,254)">href</span>=<span style="color:rgb(206,145,120)">"<a href="https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.15.1/css/ol.css">https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.15.1/css/ol.css</a>"</span> <span style="color:rgb(156,220,254)">type</span>=<span style="color:rgb(206,145,120)">"text/css"</span><span style="color:rgb(128,128,128)">></span></div><div>        <span style="color:rgb(128,128,128)"><</span><span style="color:rgb(86,156,214)">style</span><span style="color:rgb(128,128,128)">></span></div><div>          <span style="color:rgb(215,186,125)">.map</span> {</div><div>            <span style="color:rgb(156,220,254)">height</span>: <span style="color:rgb(181,206,168)">400px</span>;</div><div>            <span style="color:rgb(156,220,254)">width</span>: <span style="color:rgb(181,206,168)">100%</span>;</div><div>          }</div><div>        <span style="color:rgb(128,128,128)"></</span><span style="color:rgb(86,156,214)">style</span><span style="color:rgb(128,128,128)">></span></div><div>        <span style="color:rgb(128,128,128)"><</span><span style="color:rgb(86,156,214)">script</span> <span style="color:rgb(156,220,254)">src</span>=<span style="color:rgb(206,145,120)">"<a href="https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.15.1/build/ol.js">https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.15.1/build/ol.js</a>"</span><span style="color:rgb(128,128,128)">></</span><span style="color:rgb(86,156,214)">script</span><span style="color:rgb(128,128,128)">></span></div><div>    <span style="color:rgb(128,128,128)"></</span><span style="color:rgb(86,156,214)">head</span><span style="color:rgb(128,128,128)">></span></div><div>    <span style="color:rgb(128,128,128)"><</span><span style="color:rgb(86,156,214)">body</span><span style="color:rgb(128,128,128)">></span></div><div>        <span style="color:rgb(128,128,128)"><</span><span style="color:rgb(86,156,214)">div</span> <span style="color:rgb(156,220,254)">id</span>=<span style="color:rgb(206,145,120)">"map"</span> <span style="color:rgb(156,220,254)">class</span>=<span style="color:rgb(206,145,120)">"map"</span><span style="color:rgb(128,128,128)">></</span><span style="color:rgb(86,156,214)">div</span><span style="color:rgb(128,128,128)">></span></div><div>        <span style="color:rgb(128,128,128)"><</span><span style="color:rgb(86,156,214)">label</span> <span style="color:rgb(128,128,128)">></span>Modifier <span style="color:rgb(86,156,214)">&nbsp;</span><span style="color:rgb(128,128,128)"></</span><span style="color:rgb(86,156,214)">label</span><span style="color:rgb(128,128,128)">></span></div><div>        <span style="color:rgb(128,128,128)"><</span><span style="color:rgb(86,156,214)">button</span> <span style="color:rgb(156,220,254)">name</span>=<span style="color:rgb(206,145,120)">"modifier"</span> <span style="color:rgb(156,220,254)">id</span>=<span style="color:rgb(206,145,120)">"mod"</span> <span style="color:rgb(156,220,254)">value</span>=<span style="color:rgb(206,145,120)">"Edit"</span><span style="color:rgb(128,128,128)">></</span><span style="color:rgb(86,156,214)">button</span><span style="color:rgb(128,128,128)">></span></div><div>        <span style="color:rgb(128,128,128)"><</span><span style="color:rgb(86,156,214)">label</span> <span style="color:rgb(128,128,128)">></span>Creer <span style="color:rgb(86,156,214)">&nbsp;</span><span style="color:rgb(128,128,128)"></</span><span style="color:rgb(86,156,214)">label</span><span style="color:rgb(128,128,128)">></span></div><div>        <span style="color:rgb(128,128,128)"><</span><span style="color:rgb(86,156,214)">button</span> <span style="color:rgb(156,220,254)">name</span>=<span style="color:rgb(206,145,120)">"Creer"</span> <span style="color:rgb(156,220,254)">id</span>=<span style="color:rgb(206,145,120)">"creer"</span> <span style="color:rgb(156,220,254)">value</span>=<span style="color:rgb(206,145,120)">"creer"</span><span style="color:rgb(128,128,128)">></</span><span style="color:rgb(86,156,214)">button</span><span style="color:rgb(128,128,128)">></span></div><div>        <span style="color:rgb(128,128,128)"><</span><span style="color:rgb(86,156,214)">label</span> <span style="color:rgb(128,128,128)">></span>Stop Edition <span style="color:rgb(86,156,214)">&nbsp;</span><span style="color:rgb(128,128,128)"></</span><span style="color:rgb(86,156,214)">label</span><span style="color:rgb(128,128,128)">></span></div><div>        <span style="color:rgb(128,128,128)"><</span><span style="color:rgb(86,156,214)">button</span> <span style="color:rgb(156,220,254)">name</span>=<span style="color:rgb(206,145,120)">"stop_modif"</span> <span style="color:rgb(156,220,254)">id</span>=<span style="color:rgb(206,145,120)">"stop_mod"</span> <span style="color:rgb(156,220,254)">value</span>=<span style="color:rgb(206,145,120)">"stop_Edit"</span><span style="color:rgb(128,128,128)">></</span><span style="color:rgb(86,156,214)">button</span><span style="color:rgb(128,128,128)">></span></div><div>        <span style="color:rgb(128,128,128)"><</span><span style="color:rgb(86,156,214)">script</span><span style="color:rgb(128,128,128)">></span></div><div>          <span style="color:rgb(86,156,214)">var</span> <span style="color:rgb(156,220,254)">draw</span>, <span style="color:rgb(156,220,254)">modify</span>, <span style="color:rgb(156,220,254)">snap</span>;</div><div>          <span style="color:rgb(86,156,214)">var</span> <span style="color:rgb(156,220,254)">maprojection</span>= <span style="color:rgb(86,156,214)">new</span> <span style="color:rgb(156,220,254)">ol</span>.<span style="color:rgb(156,220,254)">proj</span>.<span style="color:rgb(220,220,170)">Projection</span>({</div><div>            <span style="color:rgb(156,220,254)">code</span><span style="color:rgb(156,220,254)">:</span><span style="color:rgb(206,145,120)">'EPSG:4326'</span>,</div><div>            <span style="color:rgb(156,220,254)">extent</span><span style="color:rgb(156,220,254)">:</span>[-<span style="color:rgb(181,206,168)">20</span>,<span style="color:rgb(181,206,168)">30</span>,<span style="color:rgb(181,206,168)">20</span>,<span style="color:rgb(181,206,168)">50</span>],</div><div>            <span style="color:rgb(156,220,254)">units</span><span style="color:rgb(156,220,254)">:</span><span style="color:rgb(206,145,120)">'degrees'</span>,</div><div>            <span style="color:rgb(156,220,254)">axisOrientation</span><span style="color:rgb(156,220,254)">:</span><span style="color:rgb(206,145,120)">'enu'</span></div><div>          });</div><div>          <span style="color:rgb(106,153,85)">//surcharge de la projection EPSG:4326</span></div><div>          <span style="color:rgb(156,220,254)">ol</span>.<span style="color:rgb(156,220,254)">proj</span>.<span style="color:rgb(220,220,170)">addEquivalentProjections</span>([<span style="color:rgb(156,220,254)">ol</span>.<span style="color:rgb(156,220,254)">proj</span>.<span style="color:rgb(220,220,170)">get</span>(<span style="color:rgb(206,145,120)">'EPSG:4326'</span>), <span style="color:rgb(156,220,254)">maprojection</span>]);</div><div>          <span style="color:rgb(86,156,214)">var</span> <span style="color:rgb(156,220,254)">wfsSource</span> = <span style="color:rgb(86,156,214)">new</span> <span style="color:rgb(156,220,254)">ol</span>.<span style="color:rgb(156,220,254)">source</span>.<span style="color:rgb(220,220,170)">Vector</span>({</div><div>            <span style="color:rgb(156,220,254)">format</span><span style="color:rgb(156,220,254)">:</span> <span style="color:rgb(86,156,214)">new</span> <span style="color:rgb(156,220,254)">ol</span>.<span style="color:rgb(156,220,254)">format</span>.<span style="color:rgb(220,220,170)">GeoJSON</span>(),</div><div>            <span style="color:rgb(220,220,170)">url</span><span style="color:rgb(156,220,254)">:</span> <span style="color:rgb(86,156,214)">function</span>(<span style="color:rgb(156,220,254)">extent</span>) {</div><div>                <span style="color:rgb(197,134,192)">return</span> <span style="color:rgb(206,145,120)">'<a href="http://127.0.0.1/cgi-bin/tinyows.exe?service=WFS&">http://127.0.0.1/cgi-bin/tinyows.exe?service=WFS&</a>'</span>+</div><div>                <span style="color:rgb(206,145,120)">'version=1.1.0&request=GetFeature&typename=tows:demo_tyny&'</span>+</div><div>                <span style="color:rgb(206,145,120)">'outputFormat=application/json&srsname=EPSG:4326&'</span>+</div><div>                <span style="color:rgb(206,145,120)">'bbox='</span>+ <span style="color:rgb(156,220,254)">extent</span>.<span style="color:rgb(220,220,170)">join</span>(<span style="color:rgb(206,145,120)">','</span>)+<span style="color:rgb(206,145,120)">',EPSG:4326'</span>;</div><div>            },</div><div>            <span style="color:rgb(156,220,254)">strategy</span><span style="color:rgb(156,220,254)">:</span> <span style="color:rgb(156,220,254)">ol</span>.<span style="color:rgb(156,220,254)">loadingstrategy</span>.<span style="color:rgb(156,220,254)">bbox</span>,</div><div>            <span style="color:rgb(156,220,254)">projection</span><span style="color:rgb(156,220,254)">:</span> <span style="color:rgb(156,220,254)">maprojection</span></div><br><div>          });</div><div>          <span style="color:rgb(86,156,214)">var</span> <span style="color:rgb(156,220,254)">vector</span> = <span style="color:rgb(86,156,214)">new</span> <span style="color:rgb(156,220,254)">ol</span>.<span style="color:rgb(156,220,254)">layer</span>.<span style="color:rgb(220,220,170)">Vector</span>({</div><div>            <span style="color:rgb(156,220,254)">source</span><span style="color:rgb(156,220,254)">:</span> <span style="color:rgb(156,220,254)">wfsSource</span>,</div><div>            <span style="color:rgb(156,220,254)">style</span><span style="color:rgb(156,220,254)">:</span> <span style="color:rgb(86,156,214)">new</span> <span style="color:rgb(156,220,254)">ol</span>.<span style="color:rgb(156,220,254)">style</span>.<span style="color:rgb(220,220,170)">Style</span>({</div><div>                <span style="color:rgb(156,220,254)">stroke</span><span style="color:rgb(156,220,254)">:</span> <span style="color:rgb(86,156,214)">new</span> <span style="color:rgb(156,220,254)">ol</span>.<span style="color:rgb(156,220,254)">style</span>.<span style="color:rgb(220,220,170)">Stroke</span>({</div><div>                    <span style="color:rgb(156,220,254)">color</span><span style="color:rgb(156,220,254)">:</span> <span style="color:rgb(206,145,120)">'rgba(0,0,255,1.0)'</span>,</div><div>                    <span style="color:rgb(156,220,254)">width</span><span style="color:rgb(156,220,254)">:</span><span style="color:rgb(181,206,168)">4</span></div><div>                })</div><div>            })</div><div>          });</div><div>          <span style="color:rgb(86,156,214)">var</span> <span style="color:rgb(156,220,254)">map</span> = <span style="color:rgb(86,156,214)">new</span> <span style="color:rgb(156,220,254)">ol</span>.<span style="color:rgb(220,220,170)">Map</span>({</div><div>            <span style="color:rgb(156,220,254)">layers</span><span style="color:rgb(156,220,254)">:</span>[<span style="color:rgb(156,220,254)">vector</span>],</div><div>            <span style="color:rgb(156,220,254)">target</span><span style="color:rgb(156,220,254)">:</span> <span style="color:rgb(156,220,254)">document</span>.<span style="color:rgb(220,220,170)">getElementById</span>(<span style="color:rgb(206,145,120)">'map'</span>),</div><div>            <span style="color:rgb(156,220,254)">view</span><span style="color:rgb(156,220,254)">:</span> <span style="color:rgb(86,156,214)">new</span> <span style="color:rgb(156,220,254)">ol</span>.<span style="color:rgb(220,220,170)">View</span>({</div><div>                <span style="color:rgb(156,220,254)">projection</span><span style="color:rgb(156,220,254)">:</span> <span style="color:rgb(156,220,254)">maprojection</span>,</div><div>                <span style="color:rgb(156,220,254)">center</span><span style="color:rgb(156,220,254)">:</span> [<span style="color:rgb(181,206,168)">2.5</span>,<span style="color:rgb(181,206,168)">46</span>],</div><div>                <span style="color:rgb(156,220,254)">maxZoom</span><span style="color:rgb(156,220,254)">:</span> <span style="color:rgb(181,206,168)">20</span>,</div><div>                <span style="color:rgb(156,220,254)">zoom</span><span style="color:rgb(156,220,254)">:</span> <span style="color:rgb(181,206,168)">1</span></div><div>            })</div><div>          });</div><div>          <span style="color:rgb(86,156,214)">var</span> <span style="color:rgb(156,220,254)">etat_edition</span>= <span style="color:rgb(156,220,254)">document</span>.<span style="color:rgb(220,220,170)">getElementById</span>(<span style="color:rgb(206,145,120)">'mod'</span>);</div><div>          <span style="color:rgb(86,156,214)">var</span> <span style="color:rgb(156,220,254)">etat_creation</span>= <span style="color:rgb(156,220,254)">document</span>.<span style="color:rgb(220,220,170)">getElementById</span>(<span style="color:rgb(206,145,120)">'creer'</span>);</div><div>          <span style="color:rgb(86,156,214)">var</span> <span style="color:rgb(156,220,254)">stop_edition</span>= <span style="color:rgb(156,220,254)">document</span>.<span style="color:rgb(220,220,170)">getElementById</span>(<span style="color:rgb(206,145,120)">'stop_mod'</span>);</div><div>          <span style="color:rgb(86,156,214)">var</span> <span style="color:rgb(156,220,254)">draw</span>, <span style="color:rgb(156,220,254)">snap</span>, <span style="color:rgb(156,220,254)">modify</span>; <span style="color:rgb(106,153,85)">//declarees globalement pour les activers ou non a la guise</span></div><div>          <span style="color:rgb(86,156,214)">var</span> <span style="color:rgb(156,220,254)">formatWFS</span> = <span style="color:rgb(86,156,214)">new</span> <span style="color:rgb(156,220,254)">ol</span>.<span style="color:rgb(156,220,254)">format</span>.<span style="color:rgb(220,220,170)">WFS</span>();</div><div>          <span style="color:rgb(86,156,214)">var</span> <span style="color:rgb(156,220,254)">xs</span> = <span style="color:rgb(86,156,214)">new</span> <span style="color:rgb(78,201,176)">XMLSerializer</span>();</div><div>          <span style="color:rgb(86,156,214)">var</span> <span style="color:rgb(156,220,254)">formatGML</span> =  <span style="color:rgb(86,156,214)">new</span> <span style="color:rgb(156,220,254)">ol</span>.<span style="color:rgb(156,220,254)">format</span>.<span style="color:rgb(220,220,170)">GML3</span>({</div><div>            <span style="color:rgb(156,220,254)">version</span><span style="color:rgb(156,220,254)">:</span><span style="color:rgb(206,145,120)">'1.1.0'</span>,</div><div>            <span style="color:rgb(156,220,254)">featureNS</span><span style="color:rgb(156,220,254)">:</span> <span style="color:rgb(206,145,120)">'<a href="http://www.mapserver.org/tinyows">http://www.mapserver.org/tinyows</a>'</span>,</div><div>            <span style="color:rgb(156,220,254)">url</span><span style="color:rgb(156,220,254)">:</span> <span style="color:rgb(206,145,120)">'<a href="http://127.0.0.1/cgi-bin/tinyows.exe">http://127.0.0.1/cgi-bin/tinyows.exe</a>'</span>,</div><div>            <span style="color:rgb(156,220,254)">featureType</span><span style="color:rgb(156,220,254)">:</span><span style="color:rgb(206,145,120)">'demo_tyny'</span>,</div><div>            <span style="color:rgb(156,220,254)">srsName</span><span style="color:rgb(156,220,254)">:</span><span style="color:rgb(206,145,120)">'EPSG:4326'</span>,</div><div>            <span style="color:rgb(156,220,254)">geometryName</span><span style="color:rgb(156,220,254)">:</span> <span style="color:rgb(206,145,120)">'geom'</span>,</div><div>            <span style="color:rgb(156,220,254)">SchemaLocation</span><span style="color:rgb(156,220,254)">:</span><span style="color:rgb(206,145,120)">'<a href="http://127.0.0.1/cgi-bin/tinyows.exe?service=wfs&request=DescribeFeatureType&version=1.1.0&typename=tows:demo_tyny">http://127.0.0.1/cgi-bin/tinyows.exe?service=wfs&request=DescribeFeatureType&version=1.1.0&typename=tows:demo_tyny</a>'</span></div><div>          });</div><div>          <span style="color:rgb(86,156,214)">var</span> <span style="color:rgb(220,220,170)">transactWFS</span> = <span style="color:rgb(86,156,214)">function</span> (<span style="color:rgb(156,220,254)">mode</span>, <span style="color:rgb(156,220,254)">f</span>) {</div><div>            <span style="color:rgb(86,156,214)">var</span> <span style="color:rgb(156,220,254)">node</span>;</div><div>            <span style="color:rgb(197,134,192)">switch</span>(<span style="color:rgb(156,220,254)">mode</span>) {</div><div>                <span style="color:rgb(197,134,192)">case</span> <span style="color:rgb(206,145,120)">'insert'</span>:</div><div>                    <span style="color:rgb(156,220,254)">mode</span> = <span style="color:rgb(156,220,254)">formatWFS</span>.<span style="color:rgb(220,220,170)">writeTransaction</span>([<span style="color:rgb(156,220,254)">f</span>], <span style="color:rgb(86,156,214)">null</span>, <span style="color:rgb(86,156,214)">null</span>, <span style="color:rgb(156,220,254)">formatGML</span>);</div><div>                    <span style="color:rgb(197,134,192)">break</span>;</div><div>                <span style="color:rgb(197,134,192)">case</span> <span style="color:rgb(206,145,120)">'update'</span>:</div><div>                    <span style="color:rgb(156,220,254)">node</span> = <span style="color:rgb(156,220,254)">formatWFS</span>.<span style="color:rgb(220,220,170)">writeTransaction</span>(<span style="color:rgb(86,156,214)">null</span>, [<span style="color:rgb(156,220,254)">f</span>], <span style="color:rgb(86,156,214)">null</span>, <span style="color:rgb(156,220,254)">formatGML</span>);</div><div>                    <span style="color:rgb(197,134,192)">break</span>;</div><div>                <span style="color:rgb(197,134,192)">case</span> <span style="color:rgb(206,145,120)">'delete'</span>:</div><div>                    <span style="color:rgb(156,220,254)">node</span> = <span style="color:rgb(156,220,254)">formatWFS</span>.<span style="color:rgb(220,220,170)">writeTransaction</span>(<span style="color:rgb(86,156,214)">null</span>, <span style="color:rgb(86,156,214)">null</span>, [<span style="color:rgb(156,220,254)">f</span>], <span style="color:rgb(156,220,254)">formatGML</span>);</div><div>                    <span style="color:rgb(197,134,192)">break</span>;</div><div>            }</div><div>            <span style="color:rgb(86,156,214)">var</span> <span style="color:rgb(156,220,254)">xml_data</span> = <span style="color:rgb(156,220,254)">xs</span>.<span style="color:rgb(220,220,170)">serializeToString</span>(<span style="color:rgb(156,220,254)">node</span>);</div><div>            <span style="color:rgb(220,220,170)">fetch</span>(<span style="color:rgb(206,145,120)">'<a href="http://localhost/cgi-bin/tinyows.exe?service=wfs">http://localhost/cgi-bin/tinyows.exe?service=wfs</a>'</span>, {</div><div>                <span style="color:rgb(156,220,254)">method</span><span style="color:rgb(156,220,254)">:</span><span style="color:rgb(206,145,120)">'POST'</span>,</div><div>                <span style="color:rgb(156,220,254)">body</span><span style="color:rgb(156,220,254)">:</span> <span style="color:rgb(156,220,254)">xml_data</span></div><div>            }).<span style="color:rgb(220,220,170)">then</span>(<span style="color:rgb(86,156,214)">function</span>() {</div><div>                <span style="color:rgb(156,220,254)">wfsSource</span>.<span style="color:rgb(220,220,170)">clear</span>();</div><div>            })</div><div>          };</div><div>          <span style="color:rgb(86,156,214)">function</span> <span style="color:rgb(220,220,170)">add_snap</span>() {</div><div>            <span style="color:rgb(156,220,254)">snap</span> = <span style="color:rgb(86,156,214)">new</span> <span style="color:rgb(156,220,254)">ol</span>.<span style="color:rgb(156,220,254)">interaction</span>.<span style="color:rgb(220,220,170)">Snap</span>({<span style="color:rgb(156,220,254)">source</span><span style="color:rgb(156,220,254)">:</span> <span style="color:rgb(156,220,254)">vector</span>.<span style="color:rgb(220,220,170)">getSource</span>()});</div><div>            <span style="color:rgb(156,220,254)">map</span>.<span style="color:rgb(220,220,170)">addInteraction</span>(<span style="color:rgb(156,220,254)">snap</span>);</div><div>          }</div><div>          <span style="color:rgb(86,156,214)">function</span> <span style="color:rgb(220,220,170)">add_modify</span>(){</div><div>            <span style="color:rgb(220,220,170)">stopInteractions</span>();</div><div>            <span style="color:rgb(220,220,170)">add_snap</span>();</div><div>            <span style="color:rgb(156,220,254)">modify</span> = <span style="color:rgb(86,156,214)">new</span> <span style="color:rgb(156,220,254)">ol</span>.<span style="color:rgb(156,220,254)">interaction</span>.<span style="color:rgb(220,220,170)">Modify</span>({<span style="color:rgb(156,220,254)">source</span><span style="color:rgb(156,220,254)">:</span> <span style="color:rgb(156,220,254)">vector</span>.<span style="color:rgb(220,220,170)">getSource</span>()});</div><div>            <span style="color:rgb(156,220,254)">map</span>.<span style="color:rgb(220,220,170)">addInteraction</span>(<span style="color:rgb(156,220,254)">modify</span>)</div><div>          }</div><div>          <span style="color:rgb(86,156,214)">function</span> <span style="color:rgb(220,220,170)">add_creer</span>(){</div><div>            <span style="color:rgb(220,220,170)">stopInteractions</span>();</div><div>            <span style="color:rgb(220,220,170)">add_snap</span>();</div><div>            <span style="color:rgb(156,220,254)">draw</span> = <span style="color:rgb(86,156,214)">new</span> <span style="color:rgb(156,220,254)">ol</span>.<span style="color:rgb(156,220,254)">interaction</span>.<span style="color:rgb(220,220,170)">Draw</span>({</div><div>                <span style="color:rgb(156,220,254)">source</span><span style="color:rgb(156,220,254)">:</span> <span style="color:rgb(156,220,254)">vector</span>.<span style="color:rgb(220,220,170)">getSource</span>(),</div><div>                <span style="color:rgb(156,220,254)">type</span><span style="color:rgb(156,220,254)">:</span><span style="color:rgb(206,145,120)">"MultiPolygon"</span>,</div><div>                <span style="color:rgb(156,220,254)">geometryName</span><span style="color:rgb(156,220,254)">:</span><span style="color:rgb(206,145,120)">'geom'</span></div><div>            });</div><div>            <span style="color:rgb(156,220,254)">draw</span>.<span style="color:rgb(220,220,170)">on</span>(<span style="color:rgb(206,145,120)">'drawend'</span>, <span style="color:rgb(86,156,214)">function</span>(<span style="color:rgb(156,220,254)">e</span>){</div><div>                <span style="color:rgb(156,220,254)">code_saisi</span>=<span style="color:rgb(220,220,170)">prompt</span>(<span style="color:rgb(206,145,120)">"code_commune"</span>);</div><div>                <span style="color:rgb(156,220,254)">e</span>.<span style="color:rgb(156,220,254)">feature</span>.<span style="color:rgb(220,220,170)">setProperties</span>({<span style="color:rgb(206,145,120)">'code_commune'</span><span style="color:rgb(156,220,254)">:code_saisi</span>});</div><div>                <span style="color:rgb(220,220,170)">transactWFS</span>(<span style="color:rgb(206,145,120)">'insert'</span>,<span style="color:rgb(156,220,254)">e</span>.<span style="color:rgb(156,220,254)">feature</span>);</div><div>            });</div><div>            <span style="color:rgb(156,220,254)">map</span>.<span style="color:rgb(220,220,170)">addInteraction</span>(<span style="color:rgb(156,220,254)">draw</span>);</div><div>          }</div><div>          <span style="color:rgb(86,156,214)">function</span> <span style="color:rgb(220,220,170)">stopInteractions</span>() {</div><div>            <span style="color:rgb(156,220,254)">map</span>.<span style="color:rgb(220,220,170)">removeInteraction</span>(<span style="color:rgb(156,220,254)">draw</span>);</div><div>            <span style="color:rgb(156,220,254)">map</span>.<span style="color:rgb(220,220,170)">removeInteraction</span>(<span style="color:rgb(156,220,254)">snap</span>);</div><div>            <span style="color:rgb(156,220,254)">map</span>.<span style="color:rgb(220,220,170)">removeInteraction</span>(<span style="color:rgb(156,220,254)">modify</span>)</div><br><div>          }</div><div>          <span style="color:rgb(156,220,254)">etat_edition</span>.<span style="color:rgb(220,220,170)">onclick</span> = <span style="color:rgb(86,156,214)">function</span>() {</div><div>            <span style="color:rgb(220,220,170)">add_modify</span>();</div><div>          };</div><div>          <span style="color:rgb(156,220,254)">etat_creation</span>.<span style="color:rgb(220,220,170)">onclick</span> = <span style="color:rgb(86,156,214)">function</span>() {</div><div>            <span style="color:rgb(220,220,170)">add_creer</span>();</div><div>          };</div><div>          <span style="color:rgb(156,220,254)">stop_edition</span>.<span style="color:rgb(220,220,170)">onclick</span> = <span style="color:rgb(86,156,214)">function</span> () {</div><div>            <span style="color:rgb(220,220,170)">stopInteractions</span>();</div><div>          };</div><div>          </div><div>        <span style="color:rgb(128,128,128)"></</span><span style="color:rgb(86,156,214)">script</span><span style="color:rgb(128,128,128)">></span></div><div>    <span style="color:rgb(128,128,128)"></</span><span style="color:rgb(86,156,214)">body</span><span style="color:rgb(128,128,128)">></span></div><div><span style="color:rgb(128,128,128)"></</span><span style="color:rgb(86,156,214)">html</span><span style="color:rgb(128,128,128)">></span></div></div></div></div>