From 5cea0a5940369e6e8762c16598dd64fd723e5e7c Mon Sep 17 00:00:00 2001 From: Sirius DevOps Date: Thu, 27 Aug 2026 17:00:09 -0400 Subject: [PATCH] map: cluster camera markers so cameras stay visible when zoomed in MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Zooming in replaced the marker group with a bbox subset, so dense world views (5k dots) thinned to a handful of pins — or zero on a wrapped world copy, where currentBBox collapsed to a sliver and the API returned ~nothing. Cameras only seemed to exist when zoomed out. - vendor leaflet.markercluster 1.5.3; camera markers now render as numbered neon-green clusters at low zoom and split into individual dots as you zoom, so camera coverage is visible at every zoom level (spiderfy at max zoom) - guard against null lat/lon rows (no phantom markers at 0,0) - stale-response guard for loadCams/loadFires: rapid wheel zoom can resolve fetches out of order and a stale bbox response blanked the map - serve index.html with Cache-Control: no-cache so the browser never keeps serving a pre-deploy copy after fixes land --- app/main.py | 7 ++- app/static/index.html | 43 +++++++++++-- .../vendor/leaflet/MarkerCluster.Default.css | 60 +++++++++++++++++++ app/static/vendor/leaflet/MarkerCluster.css | 14 +++++ .../vendor/leaflet/leaflet.markercluster.js | 2 + 5 files changed, 121 insertions(+), 5 deletions(-) create mode 100644 app/static/vendor/leaflet/MarkerCluster.Default.css create mode 100644 app/static/vendor/leaflet/MarkerCluster.css create mode 100644 app/static/vendor/leaflet/leaflet.markercluster.js diff --git a/app/main.py b/app/main.py index 9d5f64d..a484728 100644 --- a/app/main.py +++ b/app/main.py @@ -966,7 +966,12 @@ async def list_news_summaries( @app.get("/", response_class=HTMLResponse) async def index(): - return FileResponse(str(STATIC_DIR / "index.html")) + # Never let browsers serve a stale copy of the app shell: no Cache-Control + # means heuristic caching, and a stale index.html froze older bugs in users' + # tabs after deploys. Revalidate every load (ETag still returns 304). + resp = FileResponse(str(STATIC_DIR / "index.html")) + resp.headers["Cache-Control"] = "no-cache" + return resp # ── NASA GIBS basemap map tab ───────────────────────────────────────────── diff --git a/app/static/index.html b/app/static/index.html index 21f2088..d5944f1 100644 --- a/app/static/index.html +++ b/app/static/index.html @@ -5,6 +5,8 @@ OSINT Dashboard + +