Broad Map Layer ID Matching

"/home/yossef/notes/git/projects/maplibra/risks/Broad Map Layer ID Matching.md"

path: maplibra/risks/Broad Map Layer ID Matching.md

- **fileName**: Broad Map Layer ID Matching
- **Created on**: 2026-06-16 00:48:42

Broad Map Layer ID Matching

Migrated from: obs_vault

Parent: ./Theme Risk Index.md

Severity: high.

Summary

applyThemeToMap() themes and hides layers by checking whether layer IDs contain substrings like water, road, transportation, or building. This can affect app-owned or future custom layers that were not meant to be treated as basemap layers.

Code Evidence

Trigger Conditions

Likely Symptoms

Why It Matters

Layer ownership is not encoded in the check. A theme function should not mutate every layer whose ID happens to match a word. This is especially risky because the building shell is a core indoor affordance and visibility managers intentionally treat it as a special layer.

Current Tests

Missing Tests

How To Make Better

Debug Steps

  1. Inspect map.getStyle().layers before and after a theme change.
  2. Check whether building-shell layout visibility changes to none.
  3. Confirm whether the affected layer source is a basemap source or an app source.
  4. Compare the result with LayerManager visibility state.

See Also