Skip to content

Add configurable map defaults with admin Settings page#177

Open
Knobee wants to merge 7 commits intobrian7704:masterfrom
Knobee:feature/configurable-map-defaults
Open

Add configurable map defaults with admin Settings page#177
Knobee wants to merge 7 commits intobrian7704:masterfrom
Knobee:feature/configurable-map-defaults

Conversation

@Knobee
Copy link
Copy Markdown

@Knobee Knobee commented Apr 16, 2026

Summary

  • New Settings page under Admin nav with interactive map preview for configuring default lat/lon, zoom, and map layer
  • Click the map to set coordinates, scroll to zoom, dropdown switches tile layer — all bidirectionally synced with form fields
  • Map tab now loads position from: localStorage (returning user) > admin config via GET /api/config > hardcoded fallbacks
  • Saves user's map position and layer to localStorage on pan/zoom/layer change
  • Graceful degradation: if backend doesn't have /api/config endpoint (old version), falls back to hardcoded defaults with no errors

Backward compatibility

  • Old UI + New backend: no breakage, map uses hardcoded defaults
  • New UI + Old backend: GET /api/config returns 404, map falls back to hardcoded defaults, Settings page shows version mismatch message

Test plan

  • Admin > Settings page loads with current defaults
  • Click map to set lat/lon — fields update
  • Scroll to zoom — zoom field updates without recentering
  • Change layer dropdown — map preview switches tile source
  • Save settings — verify success notification
  • Map tab opens at configured position and layer
  • Pan/zoom on Map tab, navigate away and back — remembers position (localStorage)
  • Incognito window — uses admin defaults (no localStorage)
  • Header username menu renders above the map (z-index)

Companion backend PR: brian7704/OpenTAKServer#284
Fixes #165

🤖 Generated with Claude Code

Open TAK server and others added 7 commits April 16, 2026 15:30
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The axios_config wrapper is at src/axios_config.tsx and Map.tsx
is in src/pages/Map/, so the relative path was wrong. Map.tsx
originally used plain 'axios' import which works correctly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Click the map to set lat/lon, scroll to set zoom. The map layer
updates when the dropdown changes. Form fields and map stay in sync
bidirectionally.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Scroll zoom now only updates the zoom level without calling setView,
which was recentering the map. Also syncs lat/lon fields to the
current map center after zoom so the fields always reflect what
the user is looking at.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

UI Map Enhancements

1 participant