i'm using Postgis + tomcat + geoserver + openlayers for my application.
with the help of some tutorial i have reached upto gettting feature information of layers.
Next i want to edit and save permanently the editable layers.
I got the below code from net..
var editable_layer= new OpenLayers.Layer.Vector("Editable Features", {
strategies: [new OpenLayers.Strategy.BBOX(), saveStrategy],
projection: new OpenLayers.Projection("EPSG:4030"),
protocol: new OpenLayers.Protocol.WFS({
version: "1.1.0",
srsName: "EPSG:4030",
url: "http://127.0.0.1/cgi-bin/tinyows",
featureNS : "http://www.tinyows.org/",
featureType: "frida",
geometryName: "the_geom",
schema: "http://127.0.0.1/cgi-bin/tinyows?service=wfs&request=DescribeFeatureType&version=1.1.0&typename=tows:frida"
})
});
after that i have modified this like this
var editable_layer = new OpenLayers.Layer.Vector("Editable Features", {
strategies: [new OpenLayers.Strategy.BBOX(), saveStrategy],
styleMap: mystyle,
projection: new OpenLayers.Projection("EPSG:4030"),
protocol: new OpenLayers.Protocol.WFS({
version: "1.1.0",
srsName: "EPSG:4030",
url: "http://localhost:8080/geoserver/wfs",
featureNS : "http://localhost:8080",
featureType: "Test:ramcheck", **/*layer name*/**
geometryName: "the_geom",
schema: "http://localhost:8080/geoserver/wfs/DescribeFeatureType?version=1.1.0&typename=Test:ramcheck" **/*i don't know how to modify this area*/**
})
});
it is not working...:)
i can't see the layer contents on the map..
please help me with a sample code..
Thanks..
Edit
I got some featureNS, feature type and featurePrefix also
then i changed my code shown below
// create three vector layers
var wfs = new OpenLayers.Layer.Vector("Editable Features", {
strategies: [new OpenLayers.Strategy.Fixed(), saveStrategy],
styleMap: sm,
projection: new OpenLayers.Projection("EPSG:4030"),
protocol: new OpenLayers.Protocol.WFS({
version: "1.1.0",
srsName: "EPSG:4030",
url: "http://localhost:8080/geoserver/wfs",
featurePrefix: "Test", **/*workspace name*/**
featureType: "Test:ramcheck", **/*geoserver layer name*/**
featureNS : "http://localhost:8080/geoserver/test", **/*Workspace Namespace URI*/**
geometryName: "the_geom"
})
});
but, below error is showing now when i try to save the edits in my layer.
"An attempt was made to create or change an object in a way which is incorrect with regard to namespaces"
in openlayers.js below line
return data;},createElementNS:function(uri,name){var element;if(this.xmldom){if(typeof uri=="string"){element=this.xmldom.createNode(1,name,uri);}else{element=this.xmldom.createNode(1,name,"");}}else{element=document.createElementNS(uri,name);}
my geoserver workspace namespace URI is "http://localhost:8080/geoserver/test". Is there any problem in this name?
Please give your suggestions..
