I want to get attributes of feature using getFeatureInfo:
if(sss==null){
if (sld==null){
sld= new OpenLayers.Control.WMSGetFeatureInfo({
url: 'http://localhost:8080/geoserver/wms',
title: 'Identify',
layers: myLayer,
queryVisible: true
});
app.mapPanel.map.addControl(sld);
sss=app.mapPanel.map.getControlsBy('title', 'Identify');
}
}
for(var i=0;i<sss.length;i++){
alert("BROMACIA");
sss[i].activate();
}
sss[0].events.register("getfeatureinfo", app.mapPanel.map, function showInfo(evt) {
alert(evt.text)});
And nothing heppens.
When i try to do in firebug:
>>> sss[0].events.register("getfeatureinfo", app.mapPanel.map, function showInfo(evt) { alert(evt.text)});
firebug says undifined.
Whats wrong?