{Array(Object)} Hierarchical structure to build the tree. Here’s an example:
[
{
text: 'Background layers',
expanded: true,
children: [
{
text: 'OpenLayers WMS',
icon: 'http://www.openlayers.org/favicon.ico',
layerNames: ['OpenLayers WMS'],
checked: true
},
{
text: 'OpenAerialMap WMS',
layerNames: ['OpenAerialMap'],
checked: false
}
]
},
{
text: 'Overlay layers',
checked: false,
children: [
{
text: 'OpenStreetMap WMS',
icon: 'http://www.openstreetmap.org/favicon.ico',
layerNames: ['OpenStreetMap'],
checked: false
}
]
}
];
Each node can contain the following properties: text: {String} The label to show in the tree checked: {Boolean} checkbox status. If this property is not set (undefined), no checkbox is drawn. It is important to note that the checkbox status takes precedence over the state defined in the OL layer. icon: {String} Optional image URL to show as an icon. expanded: {Boolean} True of this node should be expanded at startup. Default is to have node collapsed. layerNames: {Array(String)} Array of OpenLayer layer names to associate with this node. If you are using a layer which can use sublayers (WMS or Mapserver), it is possible to use a specific syntax: <OL layer name> + separator + <sublayer identifier>. The default separator is “:”, which can be changed in the LayerTree.separator property if it conflicts. For instance: MyWMS:roads
Other properties are passed to Ext. For instance the “cls” property can be used to set a specific class on the node.