[OpenLayers-Users] filtering WFS layers
goeserver developer
bjoice at firstam.com
Wed Nov 21 03:14:35 EST 2007
hi,
I want to use the filter option with WFS.('filter':'myfilterstring' ) . But
results are not displayed.
Can Suggest a way out.
Thanks
Christopher Schmidt-4 wrote:
>
> On Fri, Sep 07, 2007 at 03:11:27PM +0100, David Herbert wrote:
>> I have a requirement to apply a property filter to a WFS layer of my map
>> e.g:
>>
>> <Filter>
>> <PropertyIsEqualTo>
>> <PropertyName>species</PropertyName>
>> <Literal>chinstrap penguin</Literal>
>> </PropertyIsEqualTo>
>> </Filter>
>>
>> for a WFS layer displaying bird colonies. Looking at the docs at:
>>
>> http://dev.openlayers.org/docs/files/OpenLayers/Layer/WFS-js.html
>>
>> leads me to believe a method called mergeNewParams is available, which
>> will modify the layer parameters and redraw it. I am using OL 2.4
>> stable. However, trying to use this method results in "mergeNewParams
>> is not a function" errors. Looking at WFS.js, I see this method is not
>> there. Should it be? If not, what's the best approach to filtering
>> layers this way? Should I remove the layer and recreate with new
>> parameters? Or is there a better way?
>
> mergeNewParams is only in trunk. But if you're not changing the filtero
> n the fly, you don't need to use it anyway: simply add a
> 'filter':'myfilterstring' in the parameters when you construct your
> layer. The parameters are the third argument to the WFS constructor.
>
> If you do need to do on-the-fly filtering, then you'll need to either go
> to trunk, or you'll need to destroy the layer and re-add it with a new
> filter when it changes.
>
> Regards,
> --
> Christopher Schmidt
> MetaCarta
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>
>
--
View this message in context: http://www.nabble.com/filtering-WFS-layers-tf4401574.html#a13872812
Sent from the OpenLayers Users mailing list archive at Nabble.com.
More information about the Users
mailing list