Layer Management

"/home/yossef/notes/git/projects/maplibra/modules/Layer Management.md"

path: maplibra/modules/Layer Management.md

- **fileName**: Layer Management
- **Created on**: 2026-06-16 00:48:42

Layer Management

Purpose: Aggregates layer mixins that render indoor geometry, labels, doors, and debug overlays.

Related: ../Home.md, ../Architecture.md, ./Map Rendering.md, ./UI Components.md, ./MVF Loading.md

What It Does

LayerManager (src/layer-manager.js) is the central hub for all map layers. It composes behavior from focused mixins rather than growing into a monolithic class. It handles base layers, debug overlays, theme switching, and visibility toggles.

Layer Mixins

Base Layers (src/layers/base-layers.js)

Debug Layers (lazy-loaded)

Debug layers are loaded on-demand via dynamic imports to keep the main bundle small:

Visibility Manager (src/layers/visibility-manager.js)

Theme Switching

setTheme() and reapplyThemeColors() update layer colors without recreating sources or layers:

Important Files

How It Connects