Recolor the offline theme towards NPS Park Tiles' palette
CI / check (push) Successful in 44s
CI / deploy (push) Successful in 13s

Extended OFFLINE_THEME's color-role overrides to lean into the warm,
Harpers-Ferry-Center-derived look of the National Park Service's own "Park
Tiles" cartography, rather than the cooler default protomaps-themes-base
palette. A handful of values (background, the park/protected-area green, the
two road-importance tiers, the park-boundary line color) are the genuine
paint colors pulled from a public Park Tiles style JSON — the "Imagery"
variant is 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.
The rest of the palette (forest/scrub greens, water, sand, buildings) is
reasoned to match that same family rather than sourced.

Recreating the color choices is fine — that's not the kind of thing a data
license restricts. What stays off-limits is their actual tile service: its
OSM/terrain layers are licensed through Mapbox Atlas, a commercial,
non-sublicensable data service scoped to NPS's own use.
This commit is contained in:
randy committed 2026-09-07 20:00:50 +02:00
1 parent 170af80cac
commit a95964db77
2 files changed
+65 -26

No files matched your search

+27 -11
View File
@@ -89,17 +89,33 @@ covering accented Latin place names (Slovak, Czech, Polish, German,
...). Labels in other scripts (Cyrillic, Greek, CJK, ...) won't render ...). Labels in other scripts (Cyrillic, Greek, CJK, ...) won't render
offline, since those glyph ranges aren't vendored. offline, since those glyph ranges aren't vendored.
`public/js/map.js`'s `OFFLINE_THEME` also nudges a handful of color `public/js/map.js`'s `OFFLINE_THEME` nudges a couple dozen color roles
roles (background, water, wood, buildings, the two road-importance from `protomaps-themes-base`'s stock "light" theme towards the
tiers) from `protomaps-themes-base`'s stock "light" theme towards the National Park Service's own "Park Tiles" cartography — a warm,
online "liberty" style's actual palette (sampled from its style JSON), Harpers-Ferry-Center-derived look. A few of these values are the
so Online/Offline don't look like two different apps. This is genuine paint colors pulled from a public Park Tiles style JSON
deliberately partial — most roles (labels, casings, minor terrain (`nps.gov/lib/npmap.js/style/ck72fwp2642dv07o7tbqinvz4.json`, the
fills, ...) are left at their theme defaults — not the kind of "Imagery" variant — the only one of NPS's four styles served from a
full per-layer recolor a previous iteration of this app did (and plain, unauthenticated URL; "Standard"/"Slate"/"Light" resolve through
removed, along with any dependency on OsmAnd's own tile server, which Mapbox Studio's private API with an access token, which isn't
this app cannot use per OsmAnd's terms restricting tile use to "personal, something to piggyback on even though it's technically visible in
non-commercial use within OsmAnd applications and platforms"). 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)
rather than sourced. This is deliberately partial — labels, casings,
and roles with no clean real-color anchor are left at theme
defaults — not the kind of full per-layer recolor a previous iteration
of this app did (and removed, along with any dependency on OsmAnd's
own tile server, which this app cannot use per OsmAnd's terms
restricting tile use to "personal, non-commercial use within OsmAnd
applications and platforms").
+
Recreating the *color choices* is fine — that's not the kind of thing
a data license restricts — but the actual Park Tiles *service* stays
off-limits: its OSM/terrain layers are licensed through Mapbox Atlas
(a commercial, non-sublicensable data service scoped to NPS), and it's
built for park visitors specifically (park-unit and trailhead
labeling prioritized), not general-purpose worldwide cartography.
No PMTiles file ships with the repository — it is expected to be No PMTiles file ships with the repository — it is expected to be
supplied locally (see `docs/development.adoc`) and stays gitignored supplied locally (see `docs/development.adoc`) and stays gitignored
+38 -15
View File
@@ -20,23 +20,46 @@ const ONLINE_STYLE = "https://tiles.openfreemap.org/styles/liberty";
const protocol = new pmtiles.Protocol(); const protocol = new pmtiles.Protocol();
addProtocol("pmtiles", protocol.tile); addProtocol("pmtiles", protocol.tile);
// A few color roles nudged from protomaps-themes-base's stock "light" theme // Nudged from protomaps-themes-base's stock "light" theme towards the
// towards the online OpenFreeMap "liberty" style's actual palette (sampled // National Park Service's own "Park Tiles" cartography — a warm,
// from its style JSON — see docs/architecture.adoc), so switching between // Harpers-Ferry-Center-derived look. Not their actual map: a handful of
// Online/Offline doesn't look like two different apps. Not a full recolor: // values below (marked) are the genuine paint colors pulled from a public
// most roles (labels, casings, minor terrain fills, ...) are left at their // Park Tiles style JSON
// theme defaults. // (nps.gov/lib/npmap.js/style/ck72fwp2642dv07o7tbqinvz4.json, the "Imagery"
// variant — the only one of their 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).
// The rest are reasoned to match that same family (warm cream ground, olive
// greens, muted blue) rather than sourced. Not a full recolor: labels,
// casings, and roles with no clean real-color anchor are left at theme
// defaults.
//
// Recreating the color choices is legitimate — that's not the kind of thing
// a data license restricts (see docs/architecture.adoc's "Offline maps"
// section) — what stays off-limits is their actual tile *service*: its
// OSM/terrain layers are licensed through Mapbox Atlas, a commercial,
// non-sublicensable data service scoped to NPS.
const OFFLINE_THEME = { const OFFLINE_THEME = {
...protomaps_themes_base.namedTheme("light"), ...protomaps_themes_base.namedTheme("light"),
background: "#f8f4f0", background: "#f9f6ef", // real: Park Tiles' own background, hsl(40, 37%, 97%)
earth: "#f8f4f0", earth: "#f9f6ef",
water: "#9ebdff", water: "#a3cedf",
wood_a: "#ace38c", wood_a: "#c3d9a0",
wood_b: "#ace38c", wood_b: "#b3c98f",
buildings: "#dcd9d6", scrub_a: "#d6e3b8",
highway: "#f2934a", scrub_b: "#cddba8",
major: "#ffeeaa", park_a: "#c8e2a0",
link: "#ffeeaa", park_b: "#b3e378", // real: Park Tiles' protected-area/park-point green
sand: "#f0e4c4",
beach: "#f0e4c4",
buildings: "#ded7cc",
pedestrian: "#e9e2d8",
highway: "#fdefbe", // real: Park Tiles' primary/highway road color
major: "#fef7dd", // real: Park Tiles' secondary road color
minor: "#fffdf8",
link: "#fef7dd",
boundaries: "#546619", // real: Park Tiles' park-boundary line color
}; };
function offlineStyle() { function offlineStyle() {