Legend
Shows the layer symbology of a sibling Map widget on the same view. You choose a source Map and, optionally, a subset of its layers, then pick how the legend is laid out.
At a glance
| Type key | arcgis-legend |
| Default size | 3 × 8 (min 2 × 4) |
| Data source | A sibling Map widget (via its live MapView) |
| Emits | — |
| Receives | — |
| Source | src/widgets/widgets/arcgis-legend/ |
Configuration
| Field | Type | Default | Purpose |
|---|---|---|---|
sourceWidgetId | string | "" | Instance id of the source Map. Empty shows the placeholder. |
sourceWidgetTitle | string | "" | Display title of the source Map (for the picker). |
layerIds | string[] | [] | Layers to include. Empty means all layers. |
respectLayerVisibility | boolean | true | Honor each layer's legendEnabled and min/max scale. |
hideLayersNotInCurrentView | boolean | true | Hide layers with no data in the current extent. |
basemapLegendVisible | boolean | false | Include basemap layers. |
legendStyle | "classic" | "card" | "classic" | Stacked list or card layout. |
cardStyleLayout | "auto" | "side-by-side" | "stack" | "auto" | Card arrangement (only when legendStyle is "card"). |
Config panel
- Data — pick the source Map widget and, optionally, the subset of operational layers to show; toggle whether to respect layer visibility rules.
- Appearance — hide layers not in the current view, include the basemap legend, and choose the legend style (and card layout when applicable).
Cross-widget actions
The Legend neither emits nor receives actions. It binds directly to the source
Map's live MapView through the
MapViewRegistry,
so it always reflects the map's current layers.
Notable behavior
- Reads the operational layers from the map at render time; an empty
layerIdsarray means show all. - Lazy-loads the ArcGIS legend CSS on first render.
- Prompts you to pick a source Map until
sourceWidgetIdis set.