[OpenLayers-Users] vendorParams in wmsGetFeatureInfo

Bart van den Eijnden bartvde at opengeo.org
Tue Apr 17 08:36:44 EDT 2012


Your findLayers function needs to return an array of OpenLayers.Layer.WMS objects, check the OpenLayers source code.

https://github.com/openlayers/openlayers/blob/master/lib/OpenLayers/Control/WMSGetFeatureInfo.js#L265

Best regards,
Bart

-- 
Bart van den Eijnden
OpenGeo - http://opengeo.org
Expert service straight from the developers.



On Apr 17, 2012, at 2:33 PM, vrbikdan wrote:

> Hi,
> still no progress. I have changed my code to this:
> 
> function infoDrill(){
>        checked();
> 	infoDrillVar = new OpenLayers.Control.WMSGetFeatureInfo({
>            url: "http://192.168.1.92:8080/geoserver/zk/wms",
>            queryVisible: false,
> 			findLayers: function (){
> 				var layers=[layers[vrs[checkedButt]]];
> 			},
> 			eventListeners: {	
>                getfeatureinfo: function(event) {
> 					 for (var i = 0; i < event.features.length; i++) {
>                       feature = event.features[i];
>                       var attDrill = feature.attributes;
> 					   zona=attDrill.zona;
> 					   alert(zona);
> 			}}}
> 			});	
> 			map.addControl(infoDrillVar);
> 			infoDrillVar.activate();	
> }
> 
> And now it tells me, that my layer is not defined. I have defined my layers
> like this: layers={layer1, layer2, layer3} so variable in findLayers
> function is changing depend on visible layer.
> 
> But I'm not sure, if findLayers will solve my problem, because I need to
> change layer in WMSGFI, but once if  infoDrillVar is add to map, every click
> uses only eventListeners part :(
> 
> Dan
> 
> --
> View this message in context: http://osgeo-org.1560.n6.nabble.com/vendorParams-in-wmsGetFeatureInfo-tp4848746p4890119.html
> Sent from the OpenLayers Users mailing list archive at Nabble.com.
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20120417/49b676b3/attachment-0001.html


More information about the Users mailing list