Skip to main content

Interface: LayerControlItem

Defined in: spec/types.ts:616

One toggle button inside a LayerControl. Clicking it flips the visibility of every referenced layer that exists in the current spec.

Remarks

layers are matched leniently: ids that do not exist in the active spec are ignored, and when none of them exist the button renders disabled (greyed, non-interactive) instead of rejecting the spec. This lets a single control be reused across spec variations where a given layer is only present in some of them.

Properties

defaultActive?

optional defaultActive?: boolean

Defined in: spec/types.ts:637

Whether the referenced layers start visible the first time this item is seen (before the user has toggled it). Defaults to true.


id

id: string

Defined in: spec/types.ts:622

Stable identity for the item. Its toggled on/off state is remembered by this id, so it persists across spec rebuilds (e.g. switching map modes) even when the underlying layer ids differ between them.


label

label: string

Defined in: spec/types.ts:624

Text shown on the toggle button.


layers

layers: string[]

Defined in: spec/types.ts:632

Ids of spec.layers toggled together when the button is clicked.


thumbnail?

optional thumbnail?: string

Defined in: spec/types.ts:630

Image shown on the item's card in the expanded panel — a URL or data URI rendered to fill the thumbnail square (cropped to cover). When omitted, a built-in stylised map preview is used, so every item looks identical.