[OpenLayers-Users] Why Filter do not work ?

Daniel Behr daniel.behr at hzg.de
Tue Mar 8 08:19:06 EST 2011


If you want to show both features use Logical.OR


Am 08.03.2011 13:50, schrieb Mustafa646:
> I used WFS protocol to get feature layer from Geoserver by using code below,
> and i successfully got all the features. But when i use filter, then nothing
> return. Can anybody explain why this occur ?
>
>   wfs = new OpenLayers.Layer.Vector("States", {
>                  strategies: [new OpenLayers.Strategy.BBOX()],
>                  protocol: new OpenLayers.Protocol.WFS({
>                      url: "http://localhost:8080/geoserver/wfs",
>                      featureType: "traget_grave3",
>                      featureNS: "http://www.openplans.org/TestSpace",
>                      srsName: "EPSG:900913",
>                      version: "1.1.0",
>                      isBaseLayer: false,
>                      visibility:true
>                  }),
>
>                  filter: new OpenLayers.Filter.Logical({
>                      type: OpenLayers.Filter.Logical.AND,
>                      filters: [
>                          new OpenLayers.Filter.Comparison({
>                              type: OpenLayers.Filter.Comparison.EQUAL_TO,
>                              property: "GRAV_ID",
>                              value: "3 A 1"
>                          }),
>                          new OpenLayers.Filter.Comparison({
>                              type: OpenLayers.Filter.Comparison.EQUAL_TO,
>                              property: "GRAV_ID",
>                              value: "3 A"
>                          })
>                      ]
>                  })
>
>              });
>
> After using filter, nothing return,
> Where is problem ?
>
> --
> View this message in context: http://osgeo-org.1803224.n2.nabble.com/Why-Filter-do-not-work-tp6124204p6124204.html
> Sent from the OpenLayers Users mailing list archive at Nabble.com.
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users


More information about the Users mailing list