<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Your findLayers function needs to return an array of OpenLayers.Layer.WMS objects, check the OpenLayers source code.<div><br></div><div><a href="https://github.com/openlayers/openlayers/blob/master/lib/OpenLayers/Control/WMSGetFeatureInfo.js#L265">https://github.com/openlayers/openlayers/blob/master/lib/OpenLayers/Control/WMSGetFeatureInfo.js#L265</a></div><div><br></div><div>Best regards,</div><div>Bart</div><div><br><div apple-content-edited="true">
<div>-- <br>Bart van den Eijnden<br>OpenGeo - <a href="http://opengeo.org/">http://opengeo.org</a><br>Expert service straight from the developers.</div><div><br></div><br class="Apple-interchange-newline">
</div>
<br><div><div>On Apr 17, 2012, at 2:33 PM, vrbikdan wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Hi,<br>still no progress. I have changed my code to this:<br><br>function infoDrill(){<br> checked();<br><span class="Apple-tab-span" style="white-space:pre">        </span>infoDrillVar = new OpenLayers.Control.WMSGetFeatureInfo({<br> url: "<a href="http://192.168.1.92:8080/geoserver/zk/wms">http://192.168.1.92:8080/geoserver/zk/wms</a>",<br> queryVisible: false,<br><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span>findLayers: function (){<br><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span>var layers=[layers[vrs[checkedButt]]];<br><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span>},<br><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span>eventListeners: {<span class="Apple-tab-span" style="white-space:pre">        </span><br> getfeatureinfo: function(event) {<br><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span> for (var i = 0; i < event.features.length; i++) {<br> feature = event.features[i];<br> var attDrill = feature.attributes;<br><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span> zona=attDrill.zona;<br><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span> alert(zona);<br><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span>}}}<br><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span>});<span class="Apple-tab-span" style="white-space:pre">        </span><br><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span>map.addControl(infoDrillVar);<br><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span>infoDrillVar.activate();<span class="Apple-tab-span" style="white-space:pre">        </span><br>}<br><br>And now it tells me, that my layer is not defined. I have defined my layers<br>like this: layers={layer1, layer2, layer3} so variable in findLayers<br>function is changing depend on visible layer.<br><br>But I'm not sure, if findLayers will solve my problem, because I need to<br>change layer in WMSGFI, but once if infoDrillVar is add to map, every click<br>uses only eventListeners part :(<br><br>Dan<br><br>--<br>View this message in context: <a href="http://osgeo-org.1560.n6.nabble.com/vendorParams-in-wmsGetFeatureInfo-tp4848746p4890119.html">http://osgeo-org.1560.n6.nabble.com/vendorParams-in-wmsGetFeatureInfo-tp4848746p4890119.html</a><br>Sent from the OpenLayers Users mailing list archive at <a href="http://Nabble.com">Nabble.com</a>.<br>_______________________________________________<br>Users mailing list<br><a href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a><br>http://lists.osgeo.org/mailman/listinfo/openlayers-users<br></div></blockquote></div><br></div></body></html>