Skip to main content

Interface: LayerControl

Defined in: spec/types.ts:626

A floating panel that expands to reveal one toggle button per LayerControlItem. Rendered by <GeoVisLayerControl>, which <GeoVisProvider> auto-mounts when spec.control is set.

Properties

icon?

optional icon?: string

Defined in: spec/types.ts:650

Icon shown on the collapsed trigger button, as a @ttoss/react-icons name (e.g. 'lucide:layers'). When omitted a built-in stacked-sheets glyph is used, so the trigger looks identical without configuration.


id

id: string

Defined in: spec/types.ts:628

Unique identifier for the panel.


items

items: LayerControlItem[]

Defined in: spec/types.ts:658

The toggle buttons revealed when the panel is expanded.


label?

optional label?: string

Defined in: spec/types.ts:644

Text shown on the collapsed trigger button. Defaults to 'Layers'.


offset?

optional offset?: number | { x?: number; y?: number; }

Defined in: spec/types.ts:642

Distance in pixels from the anchored map edges. Defaults to 40. A single number applies to both edges; pass { x, y } to offset each axis independently (each falling back to 40 when omitted) — e.g. push the control clear of a side panel horizontally without lifting it off the bottom edge. Increase it to clear map chrome (e.g. MapLibre's attribution) or app UI.


position?

optional position?: LegendPosition

Defined in: spec/types.ts:633

Corner the panel is anchored to (absolute overlay), reusing the legend position vocabulary. Defaults to 'bottom-left'.


trigger?

optional trigger?: "hover" | "click"

Defined in: spec/types.ts:656

How the panel expands to reveal its items. 'hover' (default) expands on pointer/focus enter; 'click' toggles on trigger click. Both triggers still respond to a click so touch devices can open a hover panel.