Dear All:<br>I try to built my own WFS server , I have Featureserver + mod_python +postgis on my local pc.<br>If I use OpenLayers.Control.ModifyFeature(wfs) method, how can I catch the modified feature and post it to FS?<br>
I try to collect all features from wfs layer, and send it back to featureserver. it doesn't work.<br>I have already try some example from OL examples . and I could not find a lot of information about it in ol maillinglist. <br>
It would be thanksful that somebody can point out where I should go. <br>Here is some code from my:<br><br> drawControls = {<br> point: new OpenLayers.Control.DrawFeature(vectors,<br> OpenLayers.Handler.Point),<br>
line: new OpenLayers.Control.DrawFeature(vectors,<br> OpenLayers.Handler.Path),<br> polygon: new OpenLayers.Control.DrawFeature(vectors,<br> OpenLayers.Handler.Polygon),<br>
editPolygon:new OpenLayers.Control.ModifyFeature(wfs, {<br> title: "Modify polygon"}))<br> <br> };<br><br>var arr = [];<br> var j = 0;<br>
for(var i =0; i<wfs.features.length;i++){<br> if(wfs.features[i].gml.featureType == "polygon"){<br> arr[j] = wfs2.features[i];<br> j++;<br> }<br>
}<br> json = geojson.write(arr);<br><br> new OpenLayers.Ajax.Request(url, <br> { method: 'post', <br> postBody: json,<br> requestHeaders: ['Accept', 'application/json'],<br>
onSuccess: success,<br> onFailure: function(xhr) {<br> $('info').innerHTML = "Failed upload (status code "+xhr.status+"). Check your URL."<br>
}<br> }<br> );<br><br>all the best <br><br>Sam<br>