Here is an example.<br><br>The WFS layer<br><br>var state = new OpenLayers.Layer.Vector(&quot;Karnataka&quot;, {<br>                strategies: [new OpenLayers.Strategy.BBOX()],<br>                filter:&quot;&quot;,<br>                protocol: new OpenLayers.Protocol.WFS({<br>
                    version: &quot;1.1.0&quot;,<br>                    url: &quot;<a href="http://Aparna:8085/geoserver/wfs">http://Aparna:8085/geoserver/wfs</a>&quot;,                                       <br>                    featureType: &quot;detail&quot;,<br>
                    featureNS: &quot;<a href="http://opengeo.org/India">http://opengeo.org/India</a>&quot;                    <br>                })<br>                <br>            });<br><br>next what I have is a checkbox that is used to filter the layer<br>
I have an array that added the value of every checkbox on the click event. <br><br>var list = &#39;&#39;;<br>                $(&#39;#schcat input[type=&quot;checkbox&quot;]:checked&#39;).each(function(){<br>                list += $(&#39;#schcat&#39;).attr(&#39;id&#39;).toUpperCase() +&quot;=&quot; +($(this).val()) + &#39; OR &#39;<br>
                });<br>                str =list.substring(0,list.length-3);<br>                //alert(str);<br>                var x= str.length;<br><br>If the length of the array is greater than zero then filter the layers<br>
<br>               var newfilter=format.read(str);<br>                map.layers[2].filter=newfilter;<br>                map.layers[2].refresh({force:true}); <br><br><br><br><br><br><br><br><div class="gmail_quote">On Sun, Feb 19, 2012 at 9:43 PM, Shadin <span dir="ltr">&lt;<a href="mailto:w_ward_W@hotmail.com">w_ward_W@hotmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">would you please give more details about how to do it ?<br>
where did you put the filter ?<br>
<font color="#888888"><br>
--<br>
View this message in context: <a href="http://osgeo-org.1560.n6.nabble.com/Filtering-a-vector-Layer-tp3911020p4485406.html" target="_blank">http://osgeo-org.1560.n6.nabble.com/Filtering-a-vector-Layer-tp3911020p4485406.html</a><br>

Sent from the OpenLayers Users mailing list archive at Nabble.com.<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a><br>
</font></blockquote></div><br>