This xml file contains configurations for all layertrees of a geomajas application. Just like the maps.xml contained all maps, this one contains all layertrees. For each layertree, it is necessary to define a "layerTree"-tag with a certain id. This id is used to retrieve the widget in HTML. This means that in your geomajas page, you need to define a LayerTree with this id, like so:
So we have a geomajas html page in which we want to see a layertree, called 'someLayerTree'. Now we will create a configuration in the layertree.xml that refers to 'someLayerTree', and add a few buttons to it. But that is not all! A layertree is always linked to a MapWidget. This means that in the configuration of a layertree, we need a reference to a map.
In the XML below, you see the LayerTree configuration for the 4th geomajas sample application. It targets the "sampleFutureMap", thus displaying the layerTree order as defined in the sampleFutureMap's configuration in maps.xml. Furthermore, it has defined 3 extra buttons to accompany it:
LayerVisibleTool: Button that toggle's the selected layer's visibility.
LayerLabeledTool: Button that turn the selected layer's label on and off.
LayerSnappingTool: Button that toggle the selected layer's snapping. Snapping can for example be used when editing or measuring distances.
This will result in a layertree with looking a bit like the picture below.
Note again that this configuration consists of tools only, not the layers! The layers of a layertree were added in the map's configuration! In this case, the layer 'Lakes (editable)' is selected, and for that particular layer, the first button (LayerVisibleTool) is enabled (which means it is visible).