Composants/LayerControl
LayerControl
OSSMITPanneau de couches : bascule de visibilité, opacité par couche et légende automatique, piloté directement sur les couches MapLibre par leur id.
1 Aperçu
Couches
2 Installation
$
npx shadcn add @geekles/layer-control
3 Props
| Prop | Type | Défaut | Description |
|---|---|---|---|
| layers * | ManagedLayer[] | — | Couches pilotées (id, label, opacity, legendUrl). |
| position | "top-left" | "top-right" | … | "top-right" | Coin d’ancrage du panneau. |
| collapsible | boolean | false | Rend 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.