1

I am using multiple wfs layers and using editing tools in that like edit,draw,save etc. The code is shown here......

var district = new OpenLayers.Layer.Vector("district(wfs)", {
 strategies: [new OpenLayers.Strategy.BBOX(), saveStrategy],
 //projection: new OpenLayers.Projection("EPSG:26910"),
 protocol: new OpenLayers.Protocol.WFS({
 version: "1.1.0",
 // loading data through localhost url path
 url: .../geoserver/wfs",
 featureNS : "http://www.openplans.org/topp",
 //maxExtent: mapextent,
 // layer name
 featureType: "district",
 // geometry column name
 geometryName: "the_geom",
 schema: ..../geoserver/wfs/DescribeFeatureType?version=1.1.0&;typename=topp:district"
 })
 });
 district.style = 
OpenLayers.Util.applyDefaults({strokeColor: "#0000ff"}, 
 OpenLayers.Feature.Vector.style["default"]);
var major_location = new OpenLayers.Layer.Vector("major_location", {
 strategies: [new OpenLayers.Strategy.BBOX(), saveStrategy],
 //projection: new OpenLayers.Projection("EPSG:26910"),
 protocol: new OpenLayers.Protocol.WFS({
 version: "1.1.0",
 // loading data through localhost url path
 url: .../geoserver/wfs",
 featureNS : "http://www.openplans.org/topp",
 //maxExtent: mapextent,
 // layer name
 featureType: "major_location",
 // geometry column name
 geometryName: "the_geom",
 schema: .../geoserver/wfs/DescribeFeatureType?version=1.1.0&;typename=topp:major_location"
 })
 });
 major_location.style = OpenLayers.Util.applyDefaults({strokeColor: "#0000ff"}, 
 OpenLayers.Feature.Vector.style["default"]);

Now, when i am doing editing in these layers then that editing is shown on only one layer.But,I want to edit both layers simultaneously.For editing the code that i am using is:

 var panel = new OpenLayers.Control.Panel(
 {'displayClass': 'customEditingToolbar'}
 );
 var navigate = new OpenLayers.Control.Navigation({
 title: "Pan Map"
 });
 var draw = new OpenLayers.Control.DrawFeature(
 district, OpenLayers.Handler.Polygon,
 {
 title: "Draw Feature",
 displayClass: "olControlDrawFeaturePolygon",
 multi: false
 }
 );
 var edit = new OpenLayers.Control.ModifyFeature(district,{
 title: "Modify Feature",
 displayClass: "olControlModifyFeature"
 });
 var del = new DeleteFeature(district, {title: "Delete Feature"});
 var save = new OpenLayers.Control.Button({
 title: "Save Changes",
 trigger: function() {
 if(edit.feature) {
 edit.selectControl.unselectAll();
 }
 saveStrategy.save();
 alert('saved');
 },
 displayClass: "olControlSaveFeatures"
 });
 panel.addControls([navigate, save, del, edit, draw]);
 panel.defaultControl = navigate;
 map.addControl(panel);

So,please tell me is it possible to edit multiple layers?

Ian Turton
84.1k6 gold badges93 silver badges190 bronze badges
asked Mar 6, 2013 at 9:32
4
  • According to me not possible to edit multiple layers.Not sure check out similar question gis.stackexchange.com/questions/34131/… Commented Mar 6, 2013 at 9:45
  • These all tools are working properly but on single layer at a time.But i want these tools to work on multiple layers. Commented Mar 6, 2013 at 9:54
  • 1
    possible duplicate of working with multiple wfs-t layers Commented Mar 6, 2013 at 12:26
  • That link has been blocked.But i want to know the answer of this question.Its urgent....Please give me some information about this....................Thanks.. Commented Mar 8, 2013 at 8:59

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.