← all branches

feat/atlas-sat

needs attentionviewing older commit
aec0922 · fullPR #353reviewed 2026-07-27 18:41 UTC2H · 3M · 2L · 6I
The branch
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
The changes (whole branch)
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+251
Blast
1 file, +25/−1. Static public asset. No TypeScript, no dependencies.
scrim-below-carto-layers carto-halos-hidden-in-sat-mode
typecheck· static HTML, no TStests· no test suite for atlascicoderabbit

Findings · 7

correctness4

high

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.

high

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.

medium

No double-init guard on _baseFill

apps/web/public/atlas/index.html:237

Add if(_baseFill.length)return; at top of setupBasemap().

medium

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

low

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

medium

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

low

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.

History · 3 commits

  1. 55942absafeincremental0H · 1M · 4L2026-07-28 02:12
  2. 744d655needs attentionincremental0H · 1M · 5L2026-07-28 02:04
  3. aec0922needs attentionfull2H · 3M · 2L2026-07-27 18:41current