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

Eric Lemoine eric.lemoine at camptocamp.com
Mon Mar 14 02:29:14 EDT 2011


On Friday, March 11, 2011, Andrés Maneiro <amaneiro at icarto.es> wrote:
> 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.

If no layer is provided the control will query all the WMS layers it
finds in the map.

>  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.

The control will actually query the *visible* WMS layers only.

If your WMS layers are served by different WMS services you'll need to
set drilldown to true in the control.

Good luck.

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemoine at camptocamp.com
http://www.camptocamp.com


More information about the Users mailing list