feat/atlas-intl
needs attentionc1177db · incrementalpre-PRreviewed 2026-07-27 18:30 UTC0H · 0M · 3L · 2I- Purpose
- Enhance the public Atlas SEN map with satellite imagery toggle for spatial orientation
- Goal
- Add a Mapa/Satélite basemap switcher using Esri World Imagery + CARTO label hybrid
- Sub-goals
- SG-1: International interconnections layer (MX↔US/Guatemala/Belize) — prior commit
- SG-2: Satellite basemap toggle (this commit) — setupBasemap/setBasemap, Esri World Imagery raster source + hybrid labels
- What
- Incremental: commit c1177db4 adds satellite basemap toggle — Esri World Imagery raster source + sat-scrim background layer (correct order: below CARTO symbol layers, above sat tiles), button wiring via setupBasemap()/setBasemap(), basemap_changed PostHog event, and Esri attribution in legend.
- Why
- Public-facing product differentiator — satellite hybrid view helps users orient grid infrastructure spatially on the open-source atlas.
- Areas
- apps/web/public/atlas/index.html+23−1
- Blast
- 1 file, +23/−1 lines — self-contained static HTML, no build step, no backend impact.
Findings · 5
correctness1
setupBasemap() has no re-entrant guard — double-call throws 'source already exists'
apps/web/public/atlas/index.html:235
Not triggered in practice (map.on('load') fires once), but a guard prevents breakage if style ever reloads. Fix: add 'if (_baseFill.length) return;' at the top of setupBasemap().
security1
Esri World Imagery tiles used without API key — potential ToS violation in production
apps/web/public/atlas/index.html:233
server.arcgisonline.com is publicly accessible but Esri ToS require an ArcGIS account for production use. Attribution is correctly included. Needs a product/legal decision before broadly promoting this feature.
conventions1
Esri attribution string omits 'and the GIS User Community'
apps/web/public/atlas/index.html:232
Esri's required attribution is 'Esri, Maxar, Earthstar Geographics, and the GIS User Community'. Both the map source attribution and the legend <li> should use the full string.
improvement1
Basemap preference not persisted to localStorage — resets on reload
apps/web/public/atlas/index.html:238
One-liner: localStorage.setItem/getItem('atlas_basemap') in setBasemap/setupBasemap.
seo1
Attribution not linked — Esri guidelines recommend a hyperlink to esri.com
apps/web/public/atlas/index.html:142
Minor: the map's built-in attribution control renders it as a link; the legend <li> is plain text.