Previously I declared individual layers and used the layers [layer_name]
parameter of a WMSGetFeatureInfo control to specify which layers I want the
click to apply to. Well now I am grouping layers for speed purposes and have
them defined as -
var layer_Test_Layer = new OpenLayers.Layer.WMS("test Feature",
"http://localhost/WebService/Request.aspx",
{
layers: [Layer 1,Layer 2', 'Layer 3],
VERSION: "1.1.1",
transparent: true
},
{ isBaseLayer: false,
singleTile: true,
visibility: false
}
);
Is it possible to use one of these grouped layers (like Layer 1) to specify
the layer attribute now or can I use another means to make it so only one
layer shows info about a feature when it is clicked as I need to define
several "hotspots" for certain features. Thanks for any suggestions.
Here is my original getfeatureinfo control -
//Define hotspot for Major Parks (testing purposes)
info = new OpenLayers.Control.WMSGetFeatureInfo({
url: 'http://localhost/WebService/Request.aspx',
title: 'Identify features by clicking',
queryVisible: true,
infoFormat: 'text/html',
layers: [layer_Major_Parks],
maxFeatures: 1,
hover:false
});
info.events.on({
getfeatureinfo: function(e) {
infopop = new GeoExt.Popup({ //utilizing the GeoExt popup
functionality
title: "Hotspot Information",
autoheight: true,
width: 300,
autoScroll: true,
panIn: true,
map: map,
lonlat: map.getLonLatFromPixel(e.xy),
html: e.text
})
infopop.show();
etext = e.text;
if (etext.length == 146)
{
infopop.close();
}
}});
map.addControl(info);
info.activate();
--
View this message in context:
http://osgeo-org.1803224.n2.nabble.com/WMSGetFeatureInfo-grouped-layers-can-I-use-a-single-layer-somehow-tp5756454p5756454.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users