[OpenLayers-Users] WFS + Filter

stash steffen.schwarz85 at googlemail.com
Thu Nov 26 04:29:47 EST 2009


Hello,

after discovering some examples from openlayers (and from the forum) I
finally made it, that my wfs protocol is shown on my map.

Now I want to add the filter to my wfs protocol. And that is the problem.
After adding the filter, all points are shown on my map again (the same
result as when I have no filter).

Here is my code:

var my_filter = new OpenLayers.Filter.Comparison({
    type: OpenLayers.Filter.Comparison.EQUAL_TO,
        property: "NAME",
        value: "Point_1"
    });

    var saveStrategy = new OpenLayers.Strategy.Save(options);
    var my_layer = new OpenLayers.Layer.Vector("layer", {
        strategies: [new OpenLayers.Strategy.Fixed({
            preload: false
        }), saveStrategy],
        filter: my_filter,
        styleMap: oStyleMap,
        protocol: new OpenLayers.Protocol.WFS({
            url: "http://localhost:8080/geoserver/wfs",
            featureType: "MY_GAZETTEER",
            featurePrefix: 'topp',
            featureNS: "http://www.openplans.org/topp",
            maxfeatures: 100
        })
    });

The param 'maxfeatures: 100' doesn't work too (all points are displayed).

What am I doing wrong?

Thanks for your help.

Regards
stash
-- 
View this message in context: http://n2.nabble.com/WFS-Filter-tp4049517p4070254.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.



More information about the Users mailing list