The Legend widget displays labels and symbols for layers in the scene. It supports FeatureLayer, SceneLayer, MapImageLayer, and TileLayer. The legend automatically updates when the visibility of a layer or sublayer changes.
Caution:
Currently 3D symbols with more than one symbol layer are not supported, and the size in volumetric 3D symbols, such as polygon extrusion, is not depicted by the Legend widget. See JSAPI Legend for more information.
Configure the Legend widget
This widget can be set to open automatically when an app starts. Hover over the widget and click the Do not open this widget when the app starts button to change the setting to Open this widget automatically when the app starts. (For widgets that you need to add to the app first, you can turn on this option after configuring the widget.)
There is no configuration for the Legend widget.
Use the Legend widget
To use the Legend widget, do the following:
- When the app starts, click the Legend widget to open the Legend window.
- To close the Legend window, click the close button (x) in the upper-right corner of the window.