feat(shared): keywords for MapLibre's template and theme styles

The maplibre_style slot gains two values that name no style document:
trek:template, which has MapLibre draw the user's map template the way
Leaflet does, and trek:ofm-auto, OpenFreeMap Liberty in the light theme
and OpenFreeMap Dark in the dark one. No stored row holds either, so no
saved setting changes its meaning, and a client that predates them reads
them as a foreign style and draws the default.

mapConnectHostAllows reads a host-source entry the way the browser reads
the policy (a wildcard never covers its apex, no port means the default
one), so the client can ask whether a GL map may fetch a tile before it
tries.
This commit is contained in:
Maurice
2026-11-30 15:00:09 +01:00
parent 06cd140bd3
commit dc008ad7a5
4 changed files with 70 additions and 2 deletions
+13
View File
@@ -15,6 +15,19 @@ export const OPENFREEMAP_HOST = 'tiles.openfreemap.org';
/** The style a MapLibre map draws when nobody chose one. */
export const OPENFREEMAP_DEFAULT_STYLE = `https://${OPENFREEMAP_HOST}/styles/liberty`;
/**
* Values of the `maplibre_style` setting that name no style document. No row
* held either before they were introduced, so neither changes what a saved
* setting meant, and a client that does not know them reads them as a foreign
* style and draws the default.
*/
/** MapLibre draws the user's map template (`map_tile_url`), the one Leaflet draws. */
export const MAPLIBRE_FROM_TEMPLATE = 'trek:template';
/** MapLibre draws OpenFreeMap Liberty in the light theme and OpenFreeMap Dark in the dark one. */
export const MAPLIBRE_OFM_AUTO = 'trek:ofm-auto';
/**
* The raster tile hosts TREK ships, in the order the policy lists them.
*