[OpenLayers-Users] wmsgetfeatureinfo, wmscapabilitiesstore & treepanel: how to "inject" dinamically layers

Andrés Maneiro amaneiro at icarto.es
Fri Mar 11 05:46:07 EST 2011


Hello,

I'm having problems integrating treepanel (geoext) and wmsgetfeatureinfo 
(openlayers). See what I'm trying to do:

1) load dinamically all the layers avaiable in the WMS. That's pretty 
easy by means of wmscapabilitiesstore. This example is very clear: 
http://api.geoext.org/1.0/examples/wms-tree.html

2) show a popup with info when the user clicks over one of the features 
in the map. It's also pretty easy *if* you know previously the layers, 
as this example shows:
http://openlayers.org/dev/examples/getfeatureinfo-popup.html

The problem arises when I try to glue this two concepts together.

As I see, wmsgetfeatureinfo needs to be provided with some layers (or 
map) to query over. But, I want the popup to show only the info related 
to the layers active (the ones with the checkbox on in example 1), so 
hardcoding the names of the layers in my javascript file seems not an 
option.

So, is there a way to provide the layers to wmsgetfeatureinfo control 
later, when an user clicks on the radiobutton on the layer? Or is there 
another direction to approach this problem?

best,
amaneiro

PS: sorry about the cross-posting, but I think this question could be 
related to both communities: geoext and openlayers. And I can't see to 
which fits better.



More information about the Users mailing list