feat(tile-proxy): Thunderforest Outdoors as foreign karte upstream
OpenTopoMap's hypsometric tint reads "red mountains / green flats" and looks nothing like the Swisstopo Pixelkarte the proxy hands out in-region — produced a jarring visual seam right at the CH/LI border. Thunderforest Outdoors has a muted topo palette + subtle hillshade that matches the swisstopo tile aesthetic much more closely, so use it as the abroad `karte` upstream when an API key is available. - `tile-proxy/build.rs`: reads `tile-proxy/.env` (gitignored) at build time and forwards each `KEY=VAL` line to rustc as `--env`, so the key is baked into the binary via `option_env!` and never touched at runtime. A shell env var of the same name wins over the .env entry (dotenv precedence). `cargo:rerun-if-changed=.env` + `cargo:rerun-if-env-changed` force a recompile whenever the value changes — no stale key cached in the binary. - `main.rs`: `THUNDERFOREST_API_KEY` read via `option_env!`; foreign `karte` is Thunderforest Outdoors when set, OpenTopoMap fallback when absent. Behaviour unchanged for keyless builds. - `mapTiles.ts`: page-footer attribution credits Thunderforest + OSM alongside the existing swisstopo / OpenTopoMap / Esri lines so the attribution stays correct regardless of which build is deployed. - `.gitignore`: tile-proxy build artefacts (binary, `target/`, `.env`) moved to the root gitignore with fully-qualified paths so the source tree isn't hidden by a nested gitignore quirk; the per-dir `tile-proxy/.gitignore` is removed. - README + systemd service: documentation refreshed for the new build-time key flow.
This commit is contained in:
@@ -21,10 +21,14 @@ export const TILE_URL = {
|
||||
} as const;
|
||||
|
||||
/** Combined attribution — the proxy may serve any provider depending on the
|
||||
* region in view, so all three are credited. Shown in the page footer (the
|
||||
* on-map control is disabled). */
|
||||
* region in view, so all are credited. Shown in the page footer (the on-map
|
||||
* control is disabled). Thunderforest is the primary `karte` upstream abroad
|
||||
* when the proxy was built with a `THUNDERFOREST_API_KEY`; OpenTopoMap is
|
||||
* the no-key fallback. Both are credited so the attribution stays correct
|
||||
* regardless of which build is deployed. */
|
||||
export const TILE_ATTRIBUTION =
|
||||
'© <a href="https://www.swisstopo.admin.ch/" target="_blank" rel="noopener">swisstopo</a> · ' +
|
||||
'© <a href="https://www.openstreetmap.org/copyright" target="_blank" rel="noopener">OpenStreetMap</a>, ' +
|
||||
'Maps © <a href="https://www.thunderforest.com/" target="_blank" rel="noopener">Thunderforest</a>, ' +
|
||||
'Data © <a href="https://www.openstreetmap.org/copyright" target="_blank" rel="noopener">OpenStreetMap</a> · ' +
|
||||
'<a href="https://opentopomap.org/" target="_blank" rel="noopener">OpenTopoMap</a> · ' +
|
||||
'© <a href="https://www.esri.com/" target="_blank" rel="noopener">Esri</a>';
|
||||
|
||||
Reference in New Issue
Block a user