| Building Web Applications > Using DHTML-Based JSF Components to Build Web Applications > The JViews Maps Faces Component Set > Adding a Legend |
Adding a Legend |
INDEX
PREVIOUS
NEXT
|
A legend displays and controls the visibility of the layers that compose the map. The legend is connected with the view in the usual way by using an identifier, see Code Sample 2.5:
<jvmf:mapView id="map" [...] /> <jvmf:layerTool viewId="map" [...] enabled="true" /> |
You can use the legend tool in read only mode (to display which layers are visible) by setting its enabled property to false.
The legend tool is based on an HTML TABLE element. You can style the various elements of the legend using CSS styling mechanisms. For example, if you declare your legend as follows:
<jvmf:layerTool styleClass="legendStyle" viewId="map"/>
Then you can create the following style rules to choose the appearance of the table header, background, cells, and so on.
. legendStyle {background: #d0d0d0; }
table.legendStyle {border-collapse: collapse; border: thin solid gray}
td.legendStyle {background: #d0d0d0; font-weight: normal ;}
thead.legendStyle {background: #d00000; font-weight: bold ;}
| Copyright © 1987-2007 ILOG S.A. All rights reserved. Documentation homepage. Legal terms. | PREVIOUS NEXT |