Hi List, 

I have a WFS layer with a filter like this:


    var filter = new OpenLayers.Filter.Comparison({
        type: OpenLayers.Filter.Comparison.EQUAL_TO,
        property: "property_1",
        value: 1
    });

    wfsLayer = new OpenLayers.Layer.Vector(OpenLayers.i18n("Point"), {
        strategies: [new OpenLayers.Strategy.Fixed({
            preload: false
        })],
        styleMap: wfsStyleMap,
        protocol: new OpenLayers.Protocol.WFS({
            version: "1.1.0",
            url: wfsUrl,
            extractAttributes: true,
            featureNS :  "http://www.xxx.org";,
            featureType: "point",
            geometryName: "the_geom",
            filter: filter,
            schema: wfsUrl +
"/DescribeFeatureType?version=1.1.0&typename=xxx:point"
        }
    });


This works just fine. One point is shown on the map.


Then I want to change the filter to another attribute. I've tried this way:


var newFilter = new OpenLayers.Filter.Comparison({
            type: OpenLayers.Filter.Comparison.EQUAL_TO,
            property: 'property_2',
            value: 100
        });

wfsLayer.options.protocol.filter= newFilter;
wfsLayer.refresh({force:true});


I can see in the DOM tree that the filter is updated, but the request that
is sent to the Geoserver is NOT updated. The map is updated but with the
same point as in the start. I'm I doing something wrong? I'm using OL 2.9.1 

-- 
View this message in context: 
http://osgeo-org.1803224.n2.nabble.com/WFS-filter-update-tp5490539p5490539.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to