The Map Layer Tree panel bean is represented by the IlvLayerTreePanel class. The Map Layer Tree
bean displays the layer tree, the Map Style Property Sheet bean and
a number of other beans that are accessed from this panel.
An example of the Map Layer Tree panel is shown in Map Layer Tree panel .
![maplayertreepanel.png](../usrprgmaps/_media/maplayertreepanel_default.png)
Map Layer Tree panel
Including the bean in an application
To include the Map Layer Tree panel bean
in your application, write the following lines of code:
IlvLayerTreePanel layerTreePanel = new IlvLayerTreePanel(); layerTreePanel.setView(view);
Adding the bean to a Swing container
You can then add this bean to your Swing
hierarchy.
panel.add(layerTreePanel, BorderLayout.WEST);
The Map Layer Tree panel bean then attaches itself and listens to
the IlvMapLayerTreeProperty property of the
specified manager. Whenever a layer is added or changed in the
underlying IlvMapLayerTreeModel, its name is added to
the tree, and the layer style properties (such as colors or view
visibilities) are made available for modification in the lower
part of the panel.
The Map Layer Tree panel also attaches
itself to the selection mechanism of the manager in order to
select the layer when a graphical map object is selected.