Add GPS Map Editor to asset detail view #61

Closed
opened 2026-05-31 05:47:50 +00:00 by shawn · 0 comments
Owner

Summary

Add a GPS map editor at the top of the asset detail view, allowing users to manually set an asset's GPS coordinates via an interactive Leaflet map.

Changes

  • static/index.html: Added GPS card HTML, CSS, and JS functions
    • New GPS card appears after the detail header, before the Asset Details card
    • Leaflet map with draggable marker at the asset's GPS position (or Orlando fallback)
    • 🔒 Lock/unlock toggle — marker is non-draggable when locked
    • 💾 Save GPS button — visible only when unlocked
    • Saves via existing PUT /api/assets/{id} endpoint
    • Toast notification on success, auto-refreshes detail view

Acceptance Criteria

  • GPS card appears as the first section in asset detail view
  • Shows Leaflet map with marker at asset's lat/lng (or fallback 28.5383/-81.3792)
  • Lock/unlock toggle works — locked marker is non-draggable, unlocked is draggable
  • Save button only visible when unlocked
  • PUT /api/assets/{id} called on save with lat/lng
  • Success toast and automatic re-lock after save
  • Falls back gracefully when asset has no GPS (no lock, marker editable)
## Summary Add a GPS map editor at the top of the asset detail view, allowing users to manually set an asset's GPS coordinates via an interactive Leaflet map. ## Changes - **static/index.html**: Added GPS card HTML, CSS, and JS functions - New GPS card appears after the detail header, before the Asset Details card - Leaflet map with draggable marker at the asset's GPS position (or Orlando fallback) - 🔒 Lock/unlock toggle — marker is non-draggable when locked - 💾 Save GPS button — visible only when unlocked - Saves via existing PUT /api/assets/{id} endpoint - Toast notification on success, auto-refreshes detail view ## Acceptance Criteria - [x] GPS card appears as the first section in asset detail view - [x] Shows Leaflet map with marker at asset's lat/lng (or fallback 28.5383/-81.3792) - [x] Lock/unlock toggle works — locked marker is non-draggable, unlocked is draggable - [x] Save button only visible when unlocked - [x] PUT /api/assets/{id} called on save with lat/lng - [x] Success toast and automatic re-lock after save - [x] Falls back gracefully when asset has no GPS (no lock, marker editable)
shawn closed this issue 2026-05-31 05:47:58 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shawn/canteen-asset-tracker#61