screentinker/Examples/PIP-Weather-Radar/vendor-leaflet.sh
ScreenTinker 44a0fff0ed Add PIP-Weather-Radar example (TV-style live radar overlay)
A "cut to radar" PiP recipe: a Leaflet map (vendored locally for the
CSP) with a CARTO dark basemap, an animated RainViewer radar loop, and
live NWS warning polygons drawn and color-coded (tornado/severe-tstorm/
flash-flood/flood) with a pulsing "LIVE RADAR" HUD, count chips, and a
legend. Auto-frames the view to the active warning polygon(s).

Two modes: "always" (radar always up) and "on_warning" (default) which
shows the radar only while a qualifying warning covers the configured
point and clears it when the warnings expire — like a station breaking
in during severe weather.

100% keyless / open data: RainViewer radar, CARTO/OSM basemap, NWS
alerts. Zero Node deps; Leaflet is vendored client-side via
vendor-leaflet.sh (gitignored). Offline test covers the warning gate,
color map, RainViewer tile-URL builder, and overlay-URI round-trip.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-18 20:58:52 -05:00

13 lines
609 B
Bash
Executable file

#!/usr/bin/env bash
# Download Leaflet (MIT) into this directory so it can be served same-origin from the
# signage server (the server CSP is script-src 'self', so a CDN won't load).
set -eu
VER=1.9.4
base="https://unpkg.com/leaflet@${VER}/dist"
cd "$(dirname "$0")"
echo "fetching Leaflet ${VER}..."
curl -fsSL "${base}/leaflet.js" -o leaflet.js
curl -fsSL "${base}/leaflet.css" -o leaflet.css
echo "ok: $(wc -c < leaflet.js) bytes leaflet.js, $(wc -c < leaflet.css) bytes leaflet.css"
echo "next: copy leaflet.js, leaflet.css, radar-overlay.html, radar-overlay.js into your signage server's frontend dir."