[OpenLayers-Users] WFS + Filter
Andreas Hocevar
ahocevar at opengeo.org
Mon Nov 23 03:03:12 EST 2009
Hi,
Please use Layer.Vector with a BBOX strategy and a WFS protocol instead
of Layer.WMS and see if it works then. Also double-check if your Point_1
is in the viewport, otherwise it won't be loaded because your custom
filter is combined with a BBOX filter for the viewport.
Regards,
Andreas.
stash wrote:
> Hello,
> I have a wfs layer with some points. Now I want to add a filter to this wfs
> layer, that only certain points are displayed.
>
> Here is the code:
>
> var my_filter = new OpenLayers.Filter.Comparison({
> type: OpenLayers.Filter.Comparison.EQUAL_TO,
> property: "NAME",
> value: "Point_1"
> });
> var my_layer = new OpenLayers.Layer.WFS("Points",
> "http://localhost:8080/geoserver/wfs",
> { typename: "topp:my_layer", filter: my_filter, maxfeatures:
> 1000 },
> { featureClass: OpenLayers.Feature.WFS });
>
>
> But when I start my html file, no point is shown on my map (the point with
> the name Point_1 is surely excisting). When I start my html file without the
> filter:my_filter in the wfs all points of my wfs are displayed.
>
> Is something wrong with my filter?
>
> Thanks for your help.
>
> Regards
> stash
>
--
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.
More information about the Users
mailing list