Hello,<br>I am struggling with this code where I have a cql_filter generated from a search field. If the user has not searched anything the cql_filter must be empty. I had problems getting a correct syntax if the cql_filter is empty so I had to set a default value. But when I have a search code for cql_filter it fails telling me in Firebug:<br>
<pre><code class="wrappedText focusRow">Layers and filters are mismatched, you need to provide one filter for each layer</code></pre>My cql_filter code is i.ex. this: "scientificname LIKE '%moser%' ".<br>
<br>I see the cql_filter added to the WMS request but I get the error above. Any ideas?<br><br> if (typeof param != 'undefined') {<br> var filter_param = param;<br> } else {var filter_param = 'id > 1'}<br>
info = new OpenLayers.Control.WMSGetFeatureInfo({<br> url: '<a href="http://kart.naturkart.no/geoserver/wms">http://kart.naturkart.no/geoserver/wms</a>',<br> title: 'Identify features by clicking',<br>
queryVisible: true,<br> infoFormat:'application/vnd.ogc.gml',<br> vendorParams:{<br> cql_filter: filter_param<br> }, <br>
eventListeners: {<br> /* 'Beforegetfeatureinfo': function () {<br> filter_param :filter_param<br> // this. vendorParams. settings = Math. random ();<br>
}, */<br> getfeatureinfo: function(event) {<br> if (popup) {<br> map.removePopup(popup);<br> }<br>