[Users] Help with layer tree and radio buttons

Andreas Hocevar ahocevar at opengeo.org
Tue Oct 27 18:43:34 CET 2009


Hi,

Dan Ramage wrote:
>
> I’d like to implement a layer tree that makes use of the check box to 
> turn on the layer and the radio button to allow the layer to be queried.
>
> I’ve been looking over the 
> http://dev.geoext.org/trunk/geoext/examples/tree.js example, however I 
> am just not following how it works at all.
>
> I understand that the JSON is used to configure the layer tree, 
> however I do not understand how most of the nodes get added.
>
> For instance, in the treeConfig variable, the first entry is: nodeType: "gx_baselayercontainer" and from the documentation I see that 
> gx_baselayercontainer will place all the base layer layers in that node. 
>  
> The second entry of: 
> nodeType: "gx_overlaylayercontainer",
> expanded: true,
> loader: {
>   baseAttrs: {radioGroup: "foo"}
>  }
> is where I cannot follow. I don’t see how that relates to the layers that end up in the “Overlays” node.
> Can someone explain how this works? I might be missing something fundamental, but I am lost at the moment.

This works exactly like the gx_baselayercontainer, but for the overlays. 
The loader configuration (loader: {baseAttrs...) tells the loader to add 
a radio button with the radio group "foo" to all overlay layer nodes.

Regards,
Andreas.

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



More information about the Users mailing list