Legend widget tags

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

Configuration file for the Legend widget

The general structure of the Legend widget configuration file is shown in the following conceptual graphic:

Conceptual overview of configuration options for the Legend widget.

The file is defined by a <configuration> tag that identifies it as a configuration file for the Viewer. It supports editing the basemap and operational layers that appear in its contents. It has the following child tags:

<usebasemaps>
If true, will include legends for the current basemap. The default is false.
<useoperationallayers>
If true, will include legends for the current operational layers. The default is true.
<excludelayer>
When a layer is specified (by its name, which should match the layer name in the Viewer application's main configuration file), it will not display in the Legend widget. Multiple excludelayer tags can be specified to exclude multiple layers. See the following code example:

Example for excluding layers from Legend widget:

In main configuration file:
<layer label="thelayername".../>

In the widget configuration file:
<excludelayer>thelayername</excludelayer>
<respectcurrentmapscale>
By default the Legend widget will display layers and sublayers that are currently visible in the map. Optionally, you can set the respectcurrentmapscale property to false to show all layers at all scales; then layers that are not in scale will be shown with 50 percent transparency. The legend automatically updates if the visibility of a layer or sublayer changes. If true, only shows layers and sublayers for the current scale. The default is false. See the following code example:

Example configuration file:

<configuration>
    <usebasemaps>false</usebasemaps>
    <useoperationallayers>true</useoperationallayers>
    <respectcurrentmapscale>true</respectcurrentmapscale>
<configuration>

Test drive the Legend widget.

2/15/2012