MEGAINFRA-WEBAPP/docs
DEIs 87f75dd98f feat(plant): fleet map page with GPS-denormalised vehicles, clustering, and tile switcher
Adds /dashboard/plant/map: a Leaflet view of every vehicle scanned from
the MEGA Clock kiosk, plotted at its last known position.

Schema
- vehicles.last_latitude / last_longitude / last_scanned_at /
  last_location_accuracy_m denormalised off fuel_logs so the map page
  renders every vehicle in a single query. Same best-effort pattern as
  attention_dismissed_at; updated by /api/clock/vehicle-scan after every
  successful scan. PB init defaults new number cols to 0 (not null) —
  filter uses 'last_latitude > 0 || last_latitude < 0' to mean 'real fix'.
- Indexed via idx_vehicles_last_scanned.

Map UI
- Custom SVG markers per unit_type: car silhouette for fuel, tractor
  silhouette for plant, 24x24, drop-shadowed.
- Clustering via react-leaflet-cluster over Leaflet.markercluster.
  Cluster icons colour-ramp with size (green->sky->amber->rose) and
  scale 32->54px.
- Three-button base-layer switcher: Street (OSM), Dark (ESRI Dark
  Gray Canvas — CartoDB watermarks tiles without a key), Satellite
  (ESRI World Imagery). Last choice persists in localStorage.
- Site pins: small purple map-marker divIcon, click flies the map to
  zoom level 15.
- Empty-state is a floating chip on the map rather than a full-page
  card so the map is always visible.

APIs
- /api/clock/vehicle-scan: stores the GPS fix on the fuel_logs row
  AND denormalises onto the vehicle when present; missing-coord
  scan leaves last_* untouched.

Sidebar: new Map entry under Plant group.
2026-09-22 21:39:25 +02:00
..
handoffs docs: add the Hermes brief for the needs-attention queue 2026-09-18 00:23:47 +02:00
n8n chore: 410 the old ocr-result route and archive its workflow export 2026-09-17 15:31:29 +02:00
setup feat(delivery-notes): enhance delivery note upload and processing 2026-08-26 15:33:30 +02:00
superpowers feat(worker-qr): real PDF + CSV batch export 2026-09-20 20:43:10 +02:00
api-reference.md feat(plant): fleet map page with GPS-denormalised vehicles, clustering, and tile switcher 2026-09-22 21:39:25 +02:00
architecture.md feat(dashboard): enhance operations dashboard with rain outlook and coordinate support 2026-09-06 19:59:52 +02:00
cooler-env.template docs(deploy): document POCKETBASE_ADMIN_TOKEN for process-batch + n8n 2026-08-19 20:01:45 +02:00
data-flows.md docs(schema): bring bootstrap and data-model docs back to truth 2026-09-11 16:17:41 +02:00
data-model.md feat(plant): fleet map page with GPS-denormalised vehicles, clustering, and tile switcher 2026-09-22 21:39:25 +02:00
minimax-multi-site-audit-prompt.md feat(dashboard): enhance operations dashboard with rain outlook and coordinate support 2026-09-06 19:59:52 +02:00
modules.md feat(plant): fleet map page with GPS-denormalised vehicles, clustering, and tile switcher 2026-09-22 21:39:25 +02:00
multi-site-assessment.md feat(dashboard): enhance operations dashboard with rain outlook and coordinate support 2026-09-06 19:59:52 +02:00
operations.md fix(dn): let staged ingestion run against the real PocketBase schema 2026-09-20 23:49:58 +02:00
pwa-install-verification.md docs(pwa): manual install verification steps for real devices 2026-08-30 22:42:55 +02:00