[Users] Associate 2 sublayers in a single Geoext Treeview Item...

Andreas Hocevar ahocevar at opengeo.org
Tue Feb 9 20:37:23 CET 2010


Paul james wrote:
> Hello guys...
>  
> Is it possible to associate 2 layers in a single Treeview Item ?

You mean you want e.g. l1,l2 in one sub-item and l3,l4 in another? Here 
you go:

> Example: 
> I have that layer (using SUBLAYERS)
>  var _test = new OpenLayers.Layer.WMS("TEST",
>                 _mapfile, {                 
>                     "LAYERS": ['l1', 'l2', 'l3', 'l4'],

Replace the above line with:

                    "LAYERS": ['l1,l2', 'l3,l4'],

>                      transparent: true,
>                      format: "image/png"
>                 }, {
>                     isBaseLayer: false,                  
>                     buffer: 0,
>                     visibility: true                   
>                 }); 
>  
> My treeview:
> ...
> text: "TEST",                
>                     expanded: true,
>                     children: [
>                     {
>                         nodeType: "gx_layerparam",                     
>                         layer: "TEST",
>                         param: "LAYERS",
>                         item: "l1",

                        item: "l1,l2",

>                         text: "test layer",
>                         checked: true,
>                         uiProvider: ...
>                     }
> ...
>  

Regards,
Andreas.

-- 
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.



More information about the Users mailing list