Legend¶
Shows symbology swatches for the currently visible layers — single-color swatches, category lists, and gradient bars, with the right swatch shape per geometry (dot / line / square).
- id:
legend - Surfaces:
left-panel
Place it¶
Behavior¶
- Renders only layers that are visible and have kit symbology. Raster layers (ArcGIS dynamic/tiled) and Esri vector layers using the service's own renderer are skipped — there's nothing introspectable to draw.
- Single-color layers (
simplesymbology) get one swatch shaped bygeometryType. - Categorized / graduated layers (
rawsymbology withmatch/interpolateexpressions) are auto-introspected into a category list or a gradient bar. - A layer's
symbology.descriptionrenders as a muted subtitle under its name (e.g. "Annual passengers"). - Sort order: raw symbologies first, then point → line → polygon, stable within each group.
Controlling what shows¶
- Provide an explicit legend override on
rawsymbology when auto-introspection can't read your paint. - Hide a layer from the legend (while keeping it on the map) with
hideFromLegend: true— works for any symbology kind.
The legend has no settings.ts config block of its own; it derives everything from your layers' symbology.