Composants/LayerControl

LayerControl

OSSMIT

Panneau de couches : bascule de visibilité, opacité par couche et légende automatique, piloté directement sur les couches MapLibre par leur id.

@geekles/layer-control·Source ↗
1 Aperçu
React · MapLibre GL
Couches
2 Installation
$
npx shadcn add @geekles/layer-control
3 Props
PropTypeDéfautDescription
layers *ManagedLayer[]Couches pilotées (id, label, opacity, legendUrl).
position"top-left" | "top-right" | …"top-right"Coin d’ancrage du panneau.
collapsiblebooleanfalseRend le panneau repliable.
4 Notes & gotchas
Opacité selon le type

Le panneau choisit la bonne propriété MapLibre (raster-opacity, fill-opacity, …) selon le type de la couche ciblée.