1

I want to define a featureId fiter for wfs layer like below:

wfs = new OpenLayers.Layer.Vector("WFS Vectore", {
        strategies: [new OpenLayers.Strategy.BBOX(), saveStrategy],
        projection: new OpenLayers.Projection("EPSG:4326"),
        protocol: new OpenLayers.Protocol.WFS({
            version: "1.1.0",
            srsName: "EPSG:4326",
            url: "http://localhost:8080/geoserver/iran/wms?service=WFS",
            featureType: "population",
            featureNS: "http://iran.kadaster.org",
            geometryName: "the_geom"
        }),
        filter:
            new OpenLayers.Filter.FeatureId({
                fids: ['population.913', 'population.912']
                //type: ?????
            })

    });

I don't know to what set 'type' variable in filtering option?

1
0

The problem was set fids field. When you set fids to ['population.913', 'population.912'], this means a feature that it's fids equal to 'population.913' and 'population9.12'. If you set fids field to 'population.912' or 'population.913' you get correct response

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.