[OpenLayers-Users] [OL 2.9.1] Restrict WMSGetFeatureInfo
accordingthe layers
Casper Børgesen
cbo at le34.dk
Thu Aug 26 02:38:12 EDT 2010
Hi Pierre.
The queryVisible property only allows filtering of layers which are visible. Visible in this sense are layers which in the layer switcher are marked as visible.
Thus not visible by whether a layer displays any features inside the visible area on the screen. It would be nice to have that feature also, but I don't think its possible yet.
Does this make any sense?
Regards, Casper
-----Oprindelig meddelelse-----
Fra: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] På vegne af epirus21
Sendt: 25. august 2010 09:04
Til: users at openlayers.org
Emne: [OpenLayers-Users] [OL 2.9.1] Restrict WMSGetFeatureInfo accordingthe layers
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.
_______________________________________________
Users mailing list
Users at openlayers.org
http://openlayers.org/mailman/listinfo/users
More information about the Users
mailing list