Skip to content

feat: add layer toggles and world capitals to dashboard#76

Open
PetroczyP wants to merge 3 commits intocalesthio:masterfrom
PetroczyP:master
Open

feat: add layer toggles and world capitals to dashboard#76
PetroczyP wants to merge 3 commits intocalesthio:masterfrom
PetroczyP:master

Conversation

@PetroczyP
Copy link

Summary

  • Layer Toggles: Click any Sensor Grid row to show/hide its corresponding map layer on both 3D globe and D3 flat map. Toggle state persists in localStorage across sessions. Adds visibility control for all 14 layers including 3 new rows: Weather Alerts, EPA RadNet, GDELT Events.
  • World Capitals: 245 world capitals displayed as gold dots on both map views. Includes country name, ISO code, and flag emoji in popup. Togglable via Sensor Grid like all other layers.
  • Hardened localStorage: All localStorage access wrapped in try-catch with console.warn logging. Layer ID validation prevents prototype pollution. Pre-existing unguarded localStorage.getItem for perf mode also wrapped.

All changes are in dashboard/public/jarvis.html only — no new files, no new dependencies, no build step changes.

Commits

  1. feat: add layer toggles to Sensor Grid for all 13 map layers
  2. feat: add world capitals layer with 245 cities on globe and flat map
  3. fix: correct 3 capital coordinates, harden localStorage, clean up CSS

Test plan

  • Dashboard loads without console errors at localhost:3117
  • Layer toggles: clicking any Sensor Grid row hides/shows corresponding markers on globe and flat map
  • Layer toggle state persists across page refresh (localStorage)
  • World capitals appear as gold dots on globe view
  • World capitals appear as gold dots on flat map view
  • Capitals toggle works from Sensor Grid panel
  • Capital popup shows flag, city name, country, ISO code
  • Mobile layout renders correctly (no horizontal overflow)
  • All existing features (delta panel in right sidebar, news ticker, OSINT stream, etc.) unaffected

🤖 Generated with Claude Code

PetroczyP and others added 3 commits March 21, 2026 18:51
Users can now click any Sensor Grid row to show/hide its corresponding
map layer on both 3D Globe and D3 flat map. Toggle state persists in
localStorage. Absorbs the standalone flight toggle into Air Activity.
Adds 3 new Sensor Grid rows: NOAA Weather, EPA RadNet, GDELT Events.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds 245 world capitals sourced from REST Countries API as a static
reference layer. Capitals appear as gold dots on both 3D globe and D3
flat map, togglable via the Sensor Grid panel. Each popup shows flag
emoji, city name, country, and ISO code.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix wrong coordinates: El Aaiun (lat/lng swapped), Port-aux-Francais
  (placed in France instead of Kerguelen), St. George's (Bermuda coords
  instead of Grenada)
- Wrap all localStorage access in try-catch with console.warn logging
- Add layer ID validation in toggleLayer to prevent prototype pollution
- Guard plotMarkers with isFlat check to skip wasted 3D recompute
- Merge duplicate .layer-item CSS rules into single declaration
- Simplify layerVisibility init (remove IIFE, single default path)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@PetroczyP PetroczyP requested a review from calesthio as a code owner March 23, 2026 00:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant