Thanks! Clear enough but not for a newbie like me :-) Could you supply a sample code for this? I have all the layers in an array layers[n]. How would I write the code? I have a cql_filter that I apply a search filter and I use a function like this:<div>
<br></div><div>var mLayers = map.layers;</div><div><div>for(var a = 4; a < (mLayers.length); a++ ){</div><div>    mLayers[a].mergeNewParams({'CQL_FILTER': param});</div><div>    mLayers[a].setVisibility(true);</div>
<div>}}</div></div><div>  <br><br><div class="gmail_quote">2012/6/12 Ian Turton <span dir="ltr"><<a href="mailto:ijturton@gmail.com" target="_blank">ijturton@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On 12 June 2012 11:16, Asle Benoni <<a href="mailto:asle.benoni@gmail.com">asle.benoni@gmail.com</a>> wrote:<br>
> Hello,<br>
> I am struggling with this code where I have a cql_filter generated from a<br>
> search field. If the user has not searched anything the cql_filter must be<br>
> empty. I had problems getting a correct syntax if the cql_filter is empty so<br>
> I had to set a default value. But when I have a search code for cql_filter<br>
> it fails telling me in Firebug:<br>
><br>
> Layers and filters are mismatched, you need to provide one filter for each<br>
> layer<br>
><br>
<br>
</div>That seems clear enough - you need to provide one filter for each<br>
layer that you are querying - in your case you probably want to limit<br>
the number of layers to just the one you are interested in.<br>
<span class="HOEnZb"><font color="#888888"><br>
Ian<br>
<br>
--<br>
Ian Turton<br>
</font></span></blockquote></div><br></div>