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
-
According to me not possible to edit multiple layers.Not sure check out similar question gis.stackexchange.com/questions/34131/…Sunil– Sunil2013年03月06日 09:45:52 +00:00Commented 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.user15652– user156522013年03月06日 09:54:53 +00:00Commented Mar 6, 2013 at 9:54
-
1possible duplicate of working with multiple wfs-t layersIan Turton– Ian Turton2013年03月06日 12:26:19 +00:00Commented 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..user15652– user156522013年03月08日 08:59:27 +00:00Commented Mar 8, 2013 at 8:59
default