Hi,<div>I found a value for the WMSgetFeatureInfo() function and not sure how to put in my layers.</div><div><br></div><div><span class="Apple-style-span" style="color:rgb(51,51,51);font-size:13px;line-height:16px">Do I use this:</span></div>
<div><span class="Apple-style-span" style="color:rgb(51,51,51);font-size:13px;line-height:16px"><br></span></div><div><span class="Apple-style-span" style="color:rgb(51,51,51);font-size:13px;line-height:16px">layerUrls: <how do I write several layers here?...></span></div>
<div><span class="Apple-style-span" style="color:rgb(51,51,51);font-size:13px;line-height:16px">or</span></div><div><span class="Apple-style-span" style="color:rgb(51,51,51);font-size:13px;line-height:16px">layers: </span><span class="Apple-style-span" style="color:rgb(51,51,51);font-size:13px;line-height:16px"> </span><span class="Apple-style-span" style="color:rgb(51,51,51);font-size:13px;line-height:16px"><how do I write several layers here?...></span><br>
<br></div><div>Thanks for any help!</div><div>~asle</div><div><br><div class="gmail_quote">2012/6/12 Jørgen Schøyen Nicolaysen <span dir="ltr"><<a href="mailto:smockmakker@gmail.com" target="_blank">smockmakker@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I only got a few ideas, hope they help. <br><br>1) If you are using several layers from geoserver for you WMS layer, the cql_filter may need to be a comma seperated list matching the layers on the WMS you are showing. (You are using several layers if the WMS call parameter, as seen in FireBug, shows http://.../wms?...&layers=layer1,layer2,layer3&..).  BTW: From your original code for initializing  WMSGetFeatureInfo I do not see any arrayof urls.<br>

<br>2) You should init WMSGetFeatureInfo with the parameter 'layer', which is your (openlayers) WMS layer. The 'url' parameter is only needed to pinpoint exaclty which url to use if you set up this control parameter 'layer' with an array, i think. However WMSGetFeature will try to pick an url from the layer array if it is not provided.  Why not try to read the WMSGetFeatureInfo.js class to get the ide about how this works. <br>

<br>3) The code <br><div class="im">  if (typeof param != 'undefined') {<br></div>may be wrong. 'param' may be null or "", that is not an "undefined" value. <br><br>4) You may need an proxy? <a href="http://trac.osgeo.org/openlayers/wiki/FrequentlyAskedQuestions#ProxyHost" target="_blank">http://trac.osgeo.org/openlayers/wiki/FrequentlyAskedQuestions#ProxyHost</a><br>

<br>5) You are also using CQL filter on your basemaps (according to some of the code you have shown here). Are you sure this is correct.   <br><br><br><div class="gmail_quote"><div><div class="h5">On Tue, Jun 12, 2012 at 9:02 PM, Asle Benoni <span dir="ltr"><<a href="mailto:asle.benoni@gmail.com" target="_blank">asle.benoni@gmail.com</a>></span> wrote:<br>


</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">I read in this discussion: <a href="https://getsatisfaction.com/opengeo/topics/error_in_wmsgetfeatureinfo" target="_blank">https://getsatisfaction.com/opengeo/topics/error_in_wmsgetfeatureinfo</a> that "<span style="color:rgb(65,65,66);font-family:sans-serif;font-size:13px;line-height:15px">If you use an array of URLs in your WMS layers, you do not need layerUrls." and that is exactly what I am using, an array of layers. I can see it in the WMS call to fetch features. Or am I uncorrect?</span><div>


<div><br>
<br><div class="gmail_quote">2012/6/12 Asle Benoni <span dir="ltr"><<a href="mailto:asle.benoni@gmail.com" target="_blank">asle.benoni@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



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><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>On 12 June 2012 11:16, Asle Benoni <<a href="mailto:asle.benoni@gmail.com" target="_blank">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><font color="#888888"><br>
Ian<br>
<br>
--<br>
Ian Turton<br>
</font></span></blockquote></div><br></div>
</div></div></blockquote></div><br>
</div></div><br></div></div>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.osgeo.org" target="_blank">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>
<br></blockquote></div><br>
</blockquote></div><br></div>