Try adding this instead:
*var* featureInfo = *new* OpenLayers.Control.WMSGetFeatureInfo({
url: 'http://10.0.102.11:8080/geoserver/wms',
queryVisible: true,
eventListeners: {
// featureInfo.events.on({
getfeatureinfo: *function*(e) {
*new* GeoExt.Popup({
title: "Feature Info",
width: 200,
height: 150,
autoScroll: true,
queryVisible: true,
map: map,
feature_count: 50,//Used as some layers consist of point data
that are grouped in close proximity to each other
lonlat: mapPanel.map.getLonLatFromPixel(e.xy),
html: e.text
}).show();
}
}
});
mapPanel.map.addControl(featureInfo);
featureInfo.activate();
Double check that parenthesis and braces match, I looked through it
quickly...
elshae
On Fri, Jan 14, 2011 at 10:42 AM, Evans, Barry <[email protected]> wrote:
> I think this question may have been asked before but I’ve looked online
> and can’t find it now. I’m using the following code to get feature
> information to display in a popup, for some reason however, it is only
> showing information from just one layer which is the first layer that is
> called into the map? Does anyone know if this is a problem with GeoExt or
> more likely something missing from code? Below is the snippet of code I am
> using for generating featureinfo popup:
>
>
>
>
>
> *var* featureInfo = *new* OpenLayers.Control.WMSGetFeatureInfo();
>
> featureInfo.events.on({
>
> getfeatureinfo: *function*(e) {
>
> *new* GeoExt.Popup({
>
> title: "Feature Info",
>
> width: 200,
>
> height: 150,
>
> autoScroll: true,
>
> queryVisible: true,
>
> map: map,
>
> feature_count: 50,//Used as some layers consist of point data
> that are grouped in close proximity to each other
>
> lonlat: mapPanel.map.getLonLatFromPixel(e.xy),
>
> html: e.text
>
> }).show();
>
> }
>
> });
>
>
>
> mapPanel.map.addControl(featureInfo);
>
> featureInfo.activate();
>
>
>
>
>
>
>
> Any help would be greatly appreciated.
>
>
>
> Kind regards,
>
>
>
> Barry
>
>
>
> Email: [email protected]
>
> _______________________________________________
> Users mailing list
> [email protected]
> http://www.geoext.org/cgi-bin/mailman/listinfo/users
>
>
_______________________________________________
Users mailing list
[email protected]
http://www.geoext.org/cgi-bin/mailman/listinfo/users