[OpenLayers-Users] WFS + Filter

Ivan Grcic igrcic at gmail.com
Thu Nov 26 07:47:26 EST 2009


On Thu, Nov 26, 2009 at 1:31 PM, stash <steffen.schwarz85 at googlemail.com> wrote:
>
>
>
> Hi,
>
> thanks for your answers. But I have to admit, that I don't know exactly what
> to do now. (I have not so much experience in openlayers, so I don't
> understand some of your answers.
>
>
> Kris Geusebroek wrote:
>>
>> Don't know if it works with fixed strategy but you can try to call
>> myLayer.refresh({force: true});after setting the filter
>>
>
> I did this, but nothing changed.
>
>
>
>> In the meanwhile, can you try with BBOX Strategy instead of Fixed
>> strategy?( Put your filter in layer options)
>>
>
> When I change it in BBOX strategy no data is shown on my map.
>
What is the response you get?
>
>
>>> function setRadiusFilter(ft) {
>>>        if (ft != null) {
>>>                var radiusFilter = new OpenLayers.Filter.Spatial(
>>>                        {
>>>                                type: OpenLayers.Filter.Spatial.DWITHIN,
>>>                                distance: selectedRadius,
>>>                                value: ft.geometry,
>>>                                projection: myLayer.projection
>>>                        }
>>>                );
>>>                var combinedFilter=new OpenLayers.Filter.Logical({
>>>                        type:OpenLayers.Filter.Logical.AND,
>>>                        filters:[filter,radiusFilter]
>>>                });
>>>                myLayer.filter = combinedFilter;
>>
>
> Why do I need this function? When do I call it?
>
This is only the way he made a filter, you allready have filter
created (var my_filter)
>
>
>> Stash, can you try putting defaultFilter option inside protocol params?
>>
>
> What do you mean by defaultFilter option?


       protocol: new OpenLayers.Protocol.WFS({
           url: "http://localhost:8080/geoserver/wfs",
           featureType: "MY_GAZETTEER",
           featurePrefix: 'topp',
           featureNS: "http://www.openplans.org/topp",
           maxfeatures: 100,
           defaultFilter: my_filter
       })

You have to apply the patch in order for this to work:
http://trac.openlayers.org/ticket/2292
(best is to get OL trunk version from svn)

>
>
> Thanks for your help.
>
> regards
> stash
> --
> View this message in context: http://n2.nabble.com/WFS-Filter-tp4049517p4070907.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