Hello GeoExt List,<br><br>I am new to GeoExt and so far I am very grateful that such a library is out there. I have made a map browser and now I want to have a customized layer panel. I have somewhat a grasp on how to create general layer trees, but I'd like to be able to customize mine as much as possible. I am not sure if it's because such options do not exist or if I am just unaware. <br>
<br>Here's a list of what I'd like to do:<br><br>1. I'd like to be able to have a few variables for my layers as so:<br><br> var tib_townships = new OpenLayers.Layer.WMS(<br> "Townships (Tibetan trans)", "<a href="http://10.0.102.11:8080/geoserver/wms">http://10.0.102.11:8080/geoserver/wms</a>", {layers: 'cite:tib_townships', transparent: true}, {isBaseLayer: false, displayInLayerSwitcher: true, visibility: true} <br>
);<br> <br> var chn_villages = new OpenLayers.Layer.WMS(<br> "Villages (Chinese trans)", "<a href="http://10.0.102.11:8080/geoserver/wms">http://10.0.102.11:8080/geoserver/wms</a>", {layers: 'cite:chn_villages', transparent: true}, {isBaseLayer: false, displayInLayerSwitcher: true, visibility: false} <br>
);<br> <br> var tib_villages = new OpenLayers.Layer.WMS(<br> "Villages (Tibetan trans)", "<a href="http://10.0.102.11:8080/geoserver/wms">http://10.0.102.11:8080/geoserver/wms</a>", {layers: 'cite:tib_villages', transparent: true}, {isBaseLayer: false, displayInLayerSwitcher: true, visibility: true} <br>
);<br><br>and then create this layernode to house these layers<br><br>var layerRoot = new Ext.tree.TreeNode({<br> text: "All Layers",<br> expanded: true<br> });<br>
<br> layerRoot.appendChild(new GeoExt.tree.BaseLayerContainer({<br> text: "Base Layers",<br> map: map,<br> expanded: true<br> }));<br>
<br> layerRoot.appendChild(new GeoExt.tree.LayerNode({<br> text: "Tibetan Villages",<br> layer: tib_villages,<br> loader: {param: "LAYERS"},<br>
expanded: true<br> }));<br><br>