[OpenLayers-Users] vendorParams in wmsGetFeatureInfo
vrbikdan
vrbikdan at gmail.com
Thu Apr 12 05:11:20 EDT 2012
Hi all,
I'll try to explain my problem. I have a few layers and only one is visible
and I need to use wmsGetFeatureInfo for another layer (this layer is not
visible). But I need to change layer for WMSGFI dynamicaly (after every
click in my map). So I am able to store name of this layer I need in some
variable and I need to push this variable to WMSGFI. I tried to use
vendorParams in beforegetfeatureinfo, but from some reason it doesn't work.
Can you tel me, wich way I can achieve my goal, changing layer in WMSGFI?
Code is below.
function infoDrillD(){
infoDrillVarD = new OpenLayers.Control.WMSGetFeatureInfo({
url: "http://192.168.1.92:8080/geoserver/zk/wms",
queryVisible: false,
eventListeners: {
beforegetfeatureinfo: function(ev){
this.vendorParams= {layers: [layers[variable]]};//this variable store
//layer I want to use
},
getfeatureinfo: function(event) {
for (var i = 0; i < event.features.length; i++) {
feature = event.features[i];
var attDrill = feature.attributes;
zona=attDrill.zona;
xx=attDrill.id;
alert(xx);
}}}
});
map.addControl(infoDrillVarD);
infoDrillVarD.activate();
}
I hope that I explain it well :) Thanks for your help,
Dan
--
View this message in context: http://osgeo-org.1560.n6.nabble.com/vendorParams-in-wmsGetFeatureInfo-tp4848746p4848746.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
More information about the Users
mailing list