I'm using openlayers-3 in client side and geoserver in server side. I have a vector layer. I get this layer from geoserver as follow:
var url = "http://localhost:8080/geoserver/wfs?&service=WFS&" + "version=1.1.0&request=GetFeature&typeName=points:cinema" + "&outputFormate=application/json";var format = new ol.format.WFS();source = new ol.source.Vector({ url: 'proxy.cgi?url=' + encodeURIComponent(u), format: format});cinemaLyr = new ol.layer.Vector({ title: 'Iran bound', source: source});map.addLayer(cinemaLyr);I get cinemaLyr correctly, I modify this layer and save it as follow:
var node = wfs.writeTransaction(null, [modifiedFeature], null, { featureType: "points:cinema", featureNS: "http://opengeo.org", srsName: "EPSG:4326"});var s = new XMLSerializer();var url = "http://localhost:8080/geoserver/wfs";Ext.Ajax.request({ url: 'proxy.cgi?url=' + encodeURIComponent(url), method: 'POST', xmlData: s.serializeToString(node), headers: { 'Content-Type': 'text/xml' }, success: function(response_) { response = response_; }});This code save the modifiedFeature on server, but its coordinate is displacement(x save as y in geoserver and vice versa). How do I fix it?
أكثر...
var url = "http://localhost:8080/geoserver/wfs?&service=WFS&" + "version=1.1.0&request=GetFeature&typeName=points:cinema" + "&outputFormate=application/json";var format = new ol.format.WFS();source = new ol.source.Vector({ url: 'proxy.cgi?url=' + encodeURIComponent(u), format: format});cinemaLyr = new ol.layer.Vector({ title: 'Iran bound', source: source});map.addLayer(cinemaLyr);I get cinemaLyr correctly, I modify this layer and save it as follow:
var node = wfs.writeTransaction(null, [modifiedFeature], null, { featureType: "points:cinema", featureNS: "http://opengeo.org", srsName: "EPSG:4326"});var s = new XMLSerializer();var url = "http://localhost:8080/geoserver/wfs";Ext.Ajax.request({ url: 'proxy.cgi?url=' + encodeURIComponent(url), method: 'POST', xmlData: s.serializeToString(node), headers: { 'Content-Type': 'text/xml' }, success: function(response_) { response = response_; }});This code save the modifiedFeature on server, but its coordinate is displacement(x save as y in geoserver and vice versa). How do I fix it?
أكثر...