[Users] FeatureInfo only showing for one layer?
IT Intern
itintern12 at gmail.com
Fri Jan 14 18:01:53 CET 2011
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 <be208 at exeter.ac.uk> 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: be208 at ex.ac.uk
>
> _______________________________________________
> Users mailing list
> Users at geoext.org
> http://www.geoext.org/cgi-bin/mailman/listinfo/users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20110114/4e8e8a2f/attachment-0001.htm
More information about the Users
mailing list