Give trail pages an outdoor map
Mirror to forge / mirror (push) Canceled after 0s
Validate / validate (push) Canceled after 0s
Validate / site (push) Canceled after 0s
Validate / deploy (push) Canceled after 0s

Trail maps now open on an outdoor style of our own, drawn on the same
OpenFreeMap tiles: hill shading and contour lines from the public
Terrain Tiles, woods, water, footpaths, and peaks with their heights.
Heights and contours follow the visitor's units. A switch on the map
goes back to the plain map and is remembered.

The home page's overview map is unchanged. If the elevation tiles or
the contour script fail, the map still loads without them.

The security policy allows the one elevation-tile path. The contour
add-on (maplibre-contour 0.1.1) is vendored with its licence, and the
elevation data is credited on the map, under it and in the footer.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
swaitsandClaude Fable 5.2 committed 2026-11-15 13:26:45 -07:00
1 parent 540a3220be
commit ad2223f427
15 files changed
+994 -27

No files matched your search

+40 -1
View File
@@ -1,7 +1,8 @@
# Third-party assets
Served from `/assets/`, so pages make no requests to CDNs or font services at
runtime. Map tiles, glyphs and sprites still come from OpenFreeMap.
runtime. Map tiles, glyphs and sprites still come from OpenFreeMap, and the
trail maps' elevation tiles from Terrain Tiles on AWS.
## MapLibre GL JS
@@ -25,6 +26,44 @@ To upgrade: download `dist/maplibre-gl.js`, `dist/maplibre-gl.css` and
`LICENSE.txt` of the new version into `maplibre-gl/`, update this file, and
check that the trail maps still draw.
## maplibre-contour
| File | Package | Version | Licence |
| --- | --- | --- | --- |
| `maplibre-contour/maplibre-contour.js` | maplibre-contour | 0.1.1 | BSD-3-Clause (with code from d3-contour, ISC, and vt-pbf, MIT), `maplibre-contour/LICENSE.txt` |
Draws the contour lines of the trail pages' outdoor map in the browser, from
the same elevation tiles as the relief. `maplibre-contour.js` is the package's
`dist/index.min.js` and `LICENSE.txt` its `LICENSE`, unchanged, from the npm
tarball `https://registry.npmjs.org/maplibre-contour/-/maplibre-contour-0.1.1.tgz`
(SHA-1 `d8aa3e3b62c8d097fc4eacb3d849635a0b662ede`, as the registry lists it),
downloaded 2026-11-15; unpkg serves the same bytes. SHA-256:
```text
055e45d0a76aaeaaf5a96765b8ce524abba3272456be75e715081e235ebd1262 maplibre-contour.js
b4a3261f4af65db24e6a2ca23093ac25619e6fe0b5ca5ec75fb09a49817b5c8d LICENSE.txt
```
It defines `window.mlcontour`. Only trail pages load it (deferred, after
MapLibre; `olt/layout.py` `outdoor=True`), and `app.js` draws the map without
contours when it is missing. It runs its work in a worker made from a `blob:`
URL (`worker-src blob:`) and fetches the elevation tiles there with `fetch()`
(`connect-src` names the tiles' path). No `eval`, no source map.
To upgrade: put `dist/index.min.js` of the new version here as
`maplibre-contour.js`, with its `LICENSE`, update this file, and check the
contours and the relief on a trail page in Firefox and in Chromium.
## Outdoor map style (`../map/`)
`outdoor.json` is this site's own style for the trail pages' outdoor map,
derived from OpenFreeMap's Liberty style (MIT), a fork of OSM Liberty and OSM
Bright (BSD-3-Clause code, CC BY 4.0 design). `LICENSE.txt` beside it keeps
their notices; the design credit, "© OpenMapTiles", is in the corner of every
map. The style keeps OpenFreeMap's tiles, glyphs and sprites. Its elevation
source is Terrain Tiles on AWS, the data `tools/elevation.py` uses, credited
under every trail map (`olt/common.py` `TRAIL_MAP_CREDIT`).
## Web fonts (`../fonts/`)
Latin subset only, as served by Google Fonts on 2026-11-10. Characters outside