perf: faster map overlay load #4
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "perf/map-layer-load"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Map layers hitch on first load and every pan because the default world view fetched cameras, NWS/SBW polygons, and WFIGS perimeters all at once, then tore them down and rebuilt them. This PR makes overlay load and pan/zoom cheap without changing API contracts.
What changed
zoomin the count chip instead of fetching thousands of pins and national polygons.hls.min.jsloads only on the first HLS camera popup.maxAllowableOffset~250 m,geometryPrecision=5, 500 records).GET /api/fires?format=heat→{lat,lon,i,c}; camera list drops URLs (detail viaGET /api/cameras/{id}); news omitscontentunlessinclude_content=true; event blips skipbody.Cache-Controlon overlay GETs. Lifespan replaces deprecatedon_event.moveend, skip rebuild when the 0.01° cell is unchanged, in-place marker updates by id, canvas renderer for polygons, lazy camera popup HTML.Contracts kept
GET /api/firesstill returns fullFireOutunlessformat=heat./api/map/layersstill{layers, overlays}.rtsp://hrefs. AIS key stays server-side.Tests
.venv-test/bin/python -m pytest tests/test_live_layers.py tests/test_api_live_layers.py tests/test_map_payloads.py tests/test_fire_sources.py -q→ 29 passed.How to verify
/api/cameras,/api/weather-alerts,/api/fire-perimeters.hls.min.jsdownloads then, not on boot.Heatmap uses {lat,lon,i,c}. Camera list drops URLs (detail via GET /api/cameras/{id}). Event blips skip body. News omits content unless include_content=true.