Host Mode Style Resolution

"/home/yossef/notes/git/projects/maplibra/risks/Host Mode Style Resolution.md"

path: maplibra/risks/Host Mode Style Resolution.md

- **fileName**: Host Mode Style Resolution
- **Created on**: 2026-06-16 00:48:42

Host Mode Style Resolution

Migrated from: obs_vault

Parent: ./Theme Risk Index.md

Severity: high for offline or Android deployments.

Summary

resolveMapStyle() can choose remote Mapbox or OSM network styles in host modes where the product may expect bundled PMTiles. Token presence, PMTiles flags, and runtime overrides are split across multiple checks, which makes offline behavior fragile.

Code Evidence

Trigger Conditions

Likely Symptoms

Why It Matters

Offline behavior should not silently depend on whether a token exists. Token presence is not the same as permission or ability to use remote basemaps.

Current Tests

Missing Tests

How To Make Better

Debug Steps

  1. Log host, token presence, hasPmtiles, __INGUIDE_BASEMAP_PM__, and __INGUIDE_ALLOW_REMOTE_BASEMAP__.
  2. Call resolveMapStyle('dark') and inspect whether it returns Mapbox URL, static JSON, dynamic offline style, or network raster style.
  3. Confirm whether the chosen style can load without network.

See Also