[OpenLayers-Users] WFS + Filter

Ivan Grcic igrcic at gmail.com
Thu Nov 26 05:37:23 EST 2009


Hi,

I think filter should go inside protocol params.
And try with maxFeatures instead of maxfeatures.

Let me know if it worked
Cheers

On Thu, Nov 26, 2009 at 10:29 AM, stash
<steffen.schwarz85 at googlemail.com> wrote:
>
> 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.
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>



-- 
Ivan Grcic



More information about the Users mailing list