Park Tiles look as the only base map theme: the old ONLINE_STYLE_PATCH palette and the theme switch are gone, the legend at /symbols.html shows the one look, and the docs carry the sampled Park Tiles colors
CI / check (push) Successful in 19s
CI / deploy (push) Successful in 18s

This commit is contained in:
randy committed 2026-11-18 23:36:30 +01:00
1 parent 07b623b7ca
commit 59a29e86a5
8 files changed
+76 -227

No files matched your search

+24 -29
View File
@@ -66,9 +66,9 @@ approximate the online look — two independently-maintained palettes
that drifted out of sync (building opacity, road casings, park
boundaries) every time one side changed. Planetiler's default profile
*is* OpenMapTiles, so `offlineStyle()` now just clones the same parsed
Liberty JSON `ONLINE_STYLE` already fetched, repoints its `sources`,
Liberty JSON `ONLINE_STYLE_TEMPLATE` already fetched, repoints its `sources`,
`glyphs`, and `sprite` at local copies, and applies the exact same
`ONLINE_STYLE_PATCH` recolor (below) — one palette, one place to tune
`patchOnlineStyle` recolor (below) — one palette, one place to tune
it, correct on both sides by construction rather than by re-checking
every time something changes.
@@ -111,22 +111,25 @@ snapshot under `public/vendor/liberty-sprite/` — both `offlineStyle()`
and the online style otherwise share identical `glyphs`/`sprite`
roles, just resolved to local vs. `tiles.openfreemap.org` URLs.
`public/js/map_themes.js`'s `ONLINE_STYLE_PATCH` — applied to whichever
source is loaded, online or offline (see above) — nudges Liberty's
OpenMapTiles layer ids towards a warm, National Park Service
"Park Tiles"-inspired look. A few of these values are the genuine
paint colors pulled from a public Park Tiles style JSON
(`nps.gov/lib/npmap.js/style/ck72fwp2642dv07o7tbqinvz4.json`, the
"Imagery" variant — the only one of NPS's four styles served from a
plain, unauthenticated URL; "Standard"/"Slate"/"Light" resolve through
Mapbox Studio's private API with an access token, which isn't
something to piggyback on even though it's technically visible in
their own JS bundle) — background, the park/protected-area green, the
two road-importance tiers, and the park-boundary line color. The rest
are reasoned to match that same warm family (olive greens, muted blue,
brown road casings) rather than sourced. This is deliberately
partial — labels, halos, rail, and minor overlays (cemetery/hospital/
school/pitch/track shading) are left at Liberty's own defaults.
`public/js/map_themes.js`'s `patchOnlineStyle` — applied to whichever
source is loaded, online or offline (see above) — recolors Liberty's
OpenMapTiles layer ids after the National Park Service's Park Tiles
"Standard" style (`PARK_TILES_PATCH`). Colors are sampled from the Park
Tiles legend swatches (`nps.gov/maps/web/img/legend/*-standard.png`)
plus the public "Imagery" style JSON
(`nps.gov/lib/npmap.js/style/ck72fwp2642dv07o7tbqinvz4.json`, the only
one of NPS's four styles served from a plain, unauthenticated URL;
"Standard"/"Slate"/"Light" resolve through Mapbox Studio's private API
with an access token, which isn't something to piggyback on even though
it's technically visible in their own JS bundle) — see
`docs/nps-resources.adoc` for the values. The park fill is moved above
landcover, so a whole park reads as one flat sage like theirs, with a
light-green tint band inside its boundary line; Natural Earth's
low-zoom color relief is hidden. Line widths stay Liberty's own.
`/symbols.html` draws its map legend from the same patched style.
(An earlier, looser "Park Tiles-inspired" palette, `ONLINE_STYLE_PATCH`,
was replaced by this one — it used Park Tiles' park *point* green
`#b3e378` as the area fill.)
+
Recreating the *color choices* is fine — that's not the kind of thing
a data license restricts — but the actual Park Tiles *service* stays
@@ -137,19 +140,11 @@ labeling prioritized), not general-purpose worldwide cartography —
irrelevant to this app either way now, since it never talks to NPS's
tile service, only ever OpenFreeMap/Geofabrik.
A second theme, *NPS Park Tiles* (Base map panel → Theme, remembered in
`localStorage`), is a closer take on Park Tiles' Standard style:
`PARK_TILES_PATCH` in the same file, colors sampled from the Park Tiles
legend swatches (see `docs/nps-resources.adoc`), and the park fill moved
above landcover with a tint band inside its boundary line. Both themes
live in `public/js/map_themes.js` so `/symbols.html` can draw its map
legend from the very same patched style the map uses.
`loadOnlineStyle` (`public/js/map.js`) fetches Liberty's live
`style.json` once and keeps it unpatched as `ONLINE_STYLE_TEMPLATE`;
`onlineStyle(theme)` patches a fresh copy for whichever theme is
selected — MapLibre accepts a style object anywhere it accepts a style
URL, so `applyStyle`'s `map.setStyle` takes either.
`onlineStyle()` patches a fresh copy for each `setStyle` — MapLibre
accepts a style object anywhere it accepts a style URL, so `applyStyle`'s
`map.setStyle` takes either.
That fetch runs before the map (and the rest of the page) is
constructed — a top-level `await` — so there's no flash of Liberty's
own colors before the patch lands; a 3s timeout and a catch-all fall