Legend widget

This page describes an older version, please read about the latest version at:
http://resources.arcgis.com/en/help/flex-viewer/concepts/

A legend conveys the meaning of the symbols used to represent features on the map to a map reader. Legends consist of example map symbols with labels containing explanatory text. The Legend widget provides a dynamic legend for the ArcGIS Viewer for Flex and automatically updates if the visibility of a layer or sublayer changes.

The legend widget supports dynamic, tiled, and feature layer types.

NoteNote:

If the layers are version 10 or lower, the legend is created using the ArcGIS.com legend service. To use the ArcGIS.com legend service, your map service needs to be publicly accessible, and your application must be able to access ArcGIS.com. See the ArcGIS API for Flex documentation for more details on the underlying Legend component that is used by the Legend widget.

The following image is of a Legend widget:

Screen shot of Legend widget

In the following example, the Earthquakes operational layer is displayed in the map, so the Legend widget shows its different symbology. Since the other operational layers are not currently rendered in the Viewer map display, they are not shown in the Legend widget. If they were rendered, their symbologies would be immediately added to the Legend widget contents.

When no operational layers are rendered in the map, the Legend widget will show a "no layers present" icon in its dialog window as shown in the following screen shot:

Screen shot of the no layers present icon

Basemaps are not shown in the Legend widget by default. The order in which layers appear in the Legend widget corresponds to the layer order in the Viewer configuration file. The widget can also be set to highlight scale dependencies that are set for different layers in the map by showing their legend properties with 50 percent transparency. This can be a useful indicator to map readers that additional data layers are present in the Viewer but are currently not displayed in the map because of scale dependencies.

Conceptual workflow

Conceptual workflow requires operational layers and basemaps (optional). Its uses are as follows:

Test drive the Legend widget or read its tag reference.

2/15/2012