Skip to content
LoidoltTheme 0.11.1
Svelte 5

Component

MapLegend

A key for the colours on a map — categories or a continuous ramp.

import { MapLegend } from '@loidolt/theme-maps';

Example

Focus the map to move it: arrow keys pan, plus and minus zoom, Shift with the arrows rotates and tilts.

Beside the map

  • Route
  • Stop

Notes

  • Inside a MapView it becomes a map control; outside one it sits in the page flow beside the map.

Props

Generated from the component source, so it cannot drift from the implementation.

MapLegend props
PropTypeDefaultNotes
title required string—
class string—
gradient LegendGradient—A continuous scale instead: its colours from least to most, and the two end labels.
items LegendItem[][]Categories, each with its colour.
position Corner'bottom-left'Where it sits. Inside a MapView it becomes a map control in this corner; outside one it renders in the page flow, beside the map.

Plus the attributes of HTMLAttributes<HTMLElement>, forwarded to the root element.