[OpenLayers-Users] Filtering a vector Layer

Aparna aparna.mookerjee at gmail.com
Thu Jan 5 06:41:56 EST 2012


Finally, was able to filter the vector layer,. The biggest problem was to
use multiple values and/or multiple filter options and could not create
permulation combination of OGC filters(logical, comparison, ..). This
seemed rather difficult at first. Eventually created CQL filters
which were converted. This is the layer

var state = new OpenLayers.Layer.Vector("Karnataka", {
                strategies: [new OpenLayers.Strategy.BBOX()],
                filter:"",
                protocol: new OpenLayers.Protocol.WFS({
                    version: "1.1.0",
                    url: "http://localhost:8085/geoserver/wfs",

                    featureType: "karf",
                    featureNS: "http://opengeo.org/India"

                }),


            });

and then logical OR or Logical AND was wrapped with comparison Filters and
converted to OGC.


On Wed, Jan 4, 2012 at 2:03 PM, aparna <aparna.mookerjee at gmail.com> wrote:

> Thanks Christoph,
>
> OGC filter is working with the vector layer (WFS, didnot work with the
> geojson). Though with more complex filter combinations one has to convert
> to
> CQL and then refresh the map.
>
> layer.refresh({force:true});
>
> was needed. Thanks to all for your help.
>
> Aparna
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20120105/67801f1f/attachment.html


More information about the Users mailing list