Add combined Thurgau map with switchable layers #5

Merged
clayschaad merged 1 commit from feature/shared-map-host into main 2026-11-18 19:08:09 +00:00
Owner

All three Thurgau datasets on one map, switchable as layers.

Changes

  • Shared map host: MapHost creates the single Leaflet map; the traffic, watercraft and vehicle maps are now layer components (TrafficLayer, WatercraftLayer, VehicleLayer) that attach to it, add their own data credit and remove everything on unmount. Municipality areas sit in their own pane below the other overlays.
  • Data hooks: useTrafficData, useWatercraftData, useVehicleData and useYearPlayback hold data loading and per-dataset state, used by both the single pages and the combined page.
  • Combined page /karte/thurgau:
    • "Ebenen" panel with one card per dataset: on/off switch, its controls and legend, link to the single map; collapsed on narrow screens.
    • Year controls cover the union of the active yearly layers; a layer without data for the chosen year shows a note. Traffic keeps its own day/time controls and shows its date range.
    • Municipality fill is more transparent when other layers are on.
    • Layers and year in the URL (?ebenen=fahrzeuge,boote,verkehr&jahr=2025).
    • Side panel: selected municipality, harbour or station, otherwise an overview of the active layers.
    • "In dieser Gemeinde" in the municipality panel: counting stations (inside the boundary, up to 250 m) and harbours (nearest municipality up to 1.5 km, since the shore points lie in the lake). All 64 stations and 26 harbours get a municipality.
  • Start page shows only the combined map; the single maps stay reachable via the layer cards. Old previews removed.
  • Docs: combined map in docs/datasets.md (with Mermaid diagram) and CLAUDE.md.

No backend changes.

Testing

  • npm run typecheck and npm run build pass.
  • Checked in the browser: all layers render together without console errors; toggling layers leaves nothing behind and keeps the traffic clock; selection, URL state, year notes and municipality context work; the three single pages work as before.
  • Narrow-screen layout only briefly checked.

🤖 Generated with Claude Code

All three Thurgau datasets on one map, switchable as layers. ## Changes - **Shared map host:** `MapHost` creates the single Leaflet map; the traffic, watercraft and vehicle maps are now layer components (`TrafficLayer`, `WatercraftLayer`, `VehicleLayer`) that attach to it, add their own data credit and remove everything on unmount. Municipality areas sit in their own pane below the other overlays. - **Data hooks:** `useTrafficData`, `useWatercraftData`, `useVehicleData` and `useYearPlayback` hold data loading and per-dataset state, used by both the single pages and the combined page. - **Combined page `/karte/thurgau`:** - "Ebenen" panel with one card per dataset: on/off switch, its controls and legend, link to the single map; collapsed on narrow screens. - Year controls cover the union of the active yearly layers; a layer without data for the chosen year shows a note. Traffic keeps its own day/time controls and shows its date range. - Municipality fill is more transparent when other layers are on. - Layers and year in the URL (`?ebenen=fahrzeuge,boote,verkehr&jahr=2025`). - Side panel: selected municipality, harbour or station, otherwise an overview of the active layers. - "In dieser Gemeinde" in the municipality panel: counting stations (inside the boundary, up to 250 m) and harbours (nearest municipality up to 1.5 km, since the shore points lie in the lake). All 64 stations and 26 harbours get a municipality. - **Start page** shows only the combined map; the single maps stay reachable via the layer cards. Old previews removed. - **Docs:** combined map in `docs/datasets.md` (with Mermaid diagram) and `CLAUDE.md`. No backend changes. ## Testing - `npm run typecheck` and `npm run build` pass. - Checked in the browser: all layers render together without console errors; toggling layers leaves nothing behind and keeps the traffic clock; selection, URL state, year notes and municipality context work; the three single pages work as before. - Narrow-screen layout only briefly checked. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
clayschaad added 1 commit 2026-11-18 19:05:08 +00:00
- One shared Leaflet map (MapHost) with the traffic, watercraft and
  vehicle maps turned into layer components that attach to it and clean
  up on unmount; each layer adds its own data credit
- Data loading and per-dataset state moved into hooks used by both the
  single pages and the combined page
- /karte/thurgau: layer panel with on/off switch, controls and legend per
  dataset, shared year controls for the yearly layers, traffic day/time
  controls, layers and year in the URL
- Side panel shows the selected municipality, harbour or station, or an
  overview of all active layers; the municipality panel lists the
  counting stations and harbours in that municipality
- Start page shows only the combined map; single maps are linked from
  the layer cards
- Docs: combined map in docs/datasets.md and CLAUDE.md

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
clayschaad merged commit 383226ed4f into main 2026-11-18 19:08:09 +00:00
clayschaad deleted branch feature/shared-map-host 2026-11-18 19:08:10 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: clayschaad/OpenDataVisualizer#5
No description provided.