Skip to content

legend

Stable

Says what the colours and symbols of the map mean, in a corner of the map, and hides and shows layers from its entries.

Generated from the component's definition in the library, so it always matches the version this demo runs.

Attribute Type Default Description
id required string — Unique identifier for the legend.
map_id required string — ID of the map to put the legend on.
position string "bottom-left" The corner of the map: "top-left", "top-right", "bottom-left" or "bottom-right". Defaults to "bottom-left". A new value moves the legend to that corner.
title string nil The legend's heading, an <h2> that names its list of entries. Optional.
collapsible boolean false Whether the title is a button that collapses and opens the legend, in the browser (see "Collapsing" above). Defaults to false. It needs a title.
events any [] a list of event names, or :all
global attributes global — Any other HTML attribute, passed on to the component's element.

Slots

  • item Optional.
  • gradient Optional.