Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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?

share|improve this question
    
According to me not possible to edit multiple layers.Not sure check out similar question gis.stackexchange.com/questions/34131/… –  Sunil Mar 6 '13 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 Mar 6 '13 at 9:54
1  
possible duplicate of working with multiple wfs-t layers –  iant Mar 6 '13 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 Mar 8 '13 at 8:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.