Actually, im not sure if filter should go to protocol. It should go in
layer options like you put it. Then strategy should take that filter
and apply it to the protocol when data is requested.

But I dont see any filter options inside Fixed strategy, only in BBOX
strategy. New ticket?

So setting filter manually inside protocol will maybe do the trick.

On Thu, Nov 26, 2009 at 11:37 AM, Ivan Grcic <[email protected]> wrote:
> 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
> <[email protected]> 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
>> [email protected]
>> http://openlayers.org/mailman/listinfo/users
>>
>
>
>
> --
> Ivan Grcic
>



-- 
Ivan Grcic
_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users

Reply via email to