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

+10 -6
View File
@@ -14,15 +14,19 @@
# (web/tests/test_headers.py checks this against the built site).
# Security headers for every response. No inline scripts or style elements:
# pages load same-origin scripts and styles, MapLibre runs from blob: workers,
# map images are self/data:/blob:, fonts are self-hosted, and tiles, glyphs and
# sprites are fetched from OpenFreeMap (connect-src). style-src-attr allows
# style="" attributes, which the pages use only to carry data to CSS (--km for
# the length strip, --n for the ratio bar, --pos for the verification gauge).
# pages load same-origin scripts and styles, MapLibre and the contour add-on
# run from blob: workers, map images are self/data:/blob:, fonts are
# self-hosted, and tiles, glyphs and sprites are fetched from OpenFreeMap
# (connect-src). The trail maps' relief and contours fetch elevation tiles
# (Terrain Tiles on AWS) with fetch(), from the page or the add-on's worker,
# which keeps this policy: connect-src allows that one path only, not all of
# s3.amazonaws.com. style-src-attr allows style="" attributes, which the
# pages use only to carry data to CSS (--km for the length strip, --n for the
# ratio bar, --pos for the verification gauge).
/*
X-Content-Type-Options: nosniff
Referrer-Policy: strict-origin-when-cross-origin
Content-Security-Policy: default-src 'self'; script-src 'self'; style-src 'self'; style-src-attr 'unsafe-inline'; worker-src 'self' blob:; child-src 'self' blob:; img-src 'self' data: blob:; font-src 'self'; connect-src 'self' https://tiles.openfreemap.org; object-src 'none'; base-uri 'self'; form-action 'self'; frame-ancestors 'none'
Content-Security-Policy: default-src 'self'; script-src 'self'; style-src 'self'; style-src-attr 'unsafe-inline'; worker-src 'self' blob:; child-src 'self' blob:; img-src 'self' data: blob:; font-src 'self'; connect-src 'self' https://tiles.openfreemap.org https://s3.amazonaws.com/elevation-tiles-prod/terrarium/; object-src 'none'; base-uri 'self'; form-action 'self'; frame-ancestors 'none'
# Site data. Matched by file type, not /data/*, so the pages under /data/
# (/data/, /data/schema/, /data/changelog/) revalidate like every other page.