[OpenLayers-Users] [OL 2.9.1] Restrict WMSGetFeatureInfo according the layers

epirus21 p.christopanos at ulg.ac.be
Wed Aug 25 03:04:02 EDT 2010


Hello,

I use the WMSgetfeatureinfo control to request layers. The control works
fine but i would like to query only the layers which are visible in the
view. Thus, in the WMSGetFeatureInfo control's properties, i set up the
properties "query_visible" to true :
        
infoControls = {
            click: new OpenLayers.Control.WMSGetFeatureInfo({
                url: "http://localhost/geoserver/wms", 
                title: 'Identify features by clicking',
                layers: [layer1, layer2],
                queryVisible: true
            })
        }
 
To restrict the view of layers, i use "minResolution" and "maxResolution"
properties of OpenLayers Map :

var layer1 = new OpenLayers.Layer.WMS(
            "layer1",
            "http://localhost/geoserver/wms",
            {layers: 'layer1', transparent: true},
	    {displayInLayerSwitcher: true, isBaseLayer: false, maxResolution :
572.4175625, minResolution : 572.4175625}
);

var layer2 = new OpenLayers.Layer.WMS(
            "layer2",
            "http://localhost/geoserver/wms",
            {layers: 'layer2', transparent: true},
	    {displayInLayerSwitcher: true, isBaseLayer: false, maxResolution :
143.104390625, minResolution : 143.104390625}
);

The problem is when i request the map, i obtain the informations also for
the layer which is not visible.
What is the good way to solve this problem ? To restrict GetFeatureInfo
according the layers's visibility ?

Thanks you in advance.
Pierre
-- 
View this message in context: http://osgeo-org.1803224.n2.nabble.com/OL-2-9-1-Restrict-WMSGetFeatureInfo-according-the-layers-tp5460019p5460019.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.



More information about the Users mailing list