feat/atlas-sat
needs attentionviewing older commitaec0922 · fullPR #353reviewed 2026-07-27 18:41 UTC2H · 3M · 2L · 6I- Purpose
- Add satellite basemap toggle to the Batu SEN atlas for siting-quality spatial context
- Goal
- Hybrid imagery+labels view via Esri World Imagery (no API key) with Fondo control in side panel
- Sub-goals
- Add Fondo (Mapa/Satélite) segmented control
- Load Esri World Imagery raster tiles
- Preserve CARTO label layers in satellite mode
- Emit basemap_changed analytics event
- Add Esri attribution
- What
- Single file: apps/web/public/atlas/index.html. Adds setupBasemap()/setBasemap() JS, sat raster source, sat+sat-scrim layers, Fondo HTML control, Esri attribution.
- Why
- Satellite imagery is useful for siting (terrain, open land, industrial footprints under grid layers). Esri World Imagery needs no API key.
- Areas
- apps/web/public/atlas/index.html+25−1
- Blast
- 1 file, +25/−1. Static public asset. No TypeScript, no dependencies.
Findings · 7
correctness4
sat-scrim placed below CARTO vectors — darkens imagery, not labels
apps/web/public/atlas/index.html:241
sat and sat-scrim both inserted before firstId (bottom of stack). Scrim sits below CARTO layers so it darkens the satellite imagery, not text labels. Fix: insert sat-scrim before the first CARTO symbol layer.
CARTO halo/backing layers hidden in sat mode — label halos stripped
apps/web/public/atlas/index.html:238
CARTO non-symbol layers for text halos (fill/line/background) are in _baseFill and get hidden in sat mode. Fix: exclude layers matching /-halo$|-casing$/ from _baseFill.
No double-init guard on _baseFill
apps/web/public/atlas/index.html:237
Add if(_baseFill.length)return; at top of setupBasemap().
firstId=undefined edge case inserts sat layers at top of stack
apps/web/public/atlas/index.html:240
If map.getStyle().layers is empty, addLayer appends to the top, covering data layers.
security1
Esri TMS ToS: rate limits apply at scale
apps/web/public/atlas/index.html:233
No API key, no mixed content. Esri public TMS has traffic limits — plan CDN proxy if atlas scales.
conventions1
f_base not wired through shared seg() helper
apps/web/public/atlas/index.html:243
Other seg controls use the existing seg() helper; f_base has inline wiring. Works but deviates from the pattern.
improvement1
Consider excluding CARTO halo layers from _baseFill
apps/web/public/atlas/index.html:238
Filter /-halo$|-casing$/.test(l.id) in addition to symbol-type exclusion.