Add map previews to journal route and activity pages
- Route/activity list pages: map thumbnails with route drawn on OSM tiles - Route/activity detail pages: interactive Leaflet map with zoom controls - Server: expose GeoJSON from PostGIS via ST_AsGeoJSON (simplified for lists) - RouteMapThumbnail component: shared, supports thumbnail and interactive modes - Placeholder shown for routes/activities without geometry - Archive journal-route-previews change, sync specs Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
3a4af698ca
commit
6aac8bd885
16 changed files with 399 additions and 39 deletions
|
|
@ -0,0 +1,9 @@
|
|||
## MODIFIED Requirements
|
||||
|
||||
### Requirement: Map components used in journal app
|
||||
The `@trails-cool/map` package's `MapView` and `RouteLayer` components SHALL be used in the journal app for route previews, in addition to the planner.
|
||||
|
||||
#### Scenario: Journal uses shared map components
|
||||
- **WHEN** the journal renders a route map preview or detail map
|
||||
- **THEN** it uses `MapView` and `RouteLayer` from `@trails-cool/map`
|
||||
- **AND** no map code is duplicated between planner and journal
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
## MODIFIED Requirements
|
||||
|
||||
### Requirement: Route data includes geometry for rendering
|
||||
Route and activity loaders SHALL return GeoJSON geometry when available.
|
||||
|
||||
#### Scenario: Route list returns simplified geometry
|
||||
- **WHEN** the routes list loader runs
|
||||
- **THEN** each route includes a `geojson` field containing the geometry as a GeoJSON string
|
||||
- **AND** the geometry is simplified server-side via `ST_Simplify()` for list page performance
|
||||
|
||||
#### Scenario: Route detail returns full geometry
|
||||
- **WHEN** the route detail loader runs and the route has geometry
|
||||
- **THEN** the route includes a `geojson` field with the full-resolution GeoJSON geometry
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
## ADDED Requirements
|
||||
|
||||
### Requirement: Route map preview on list pages
|
||||
Route and activity list pages SHALL show a small map thumbnail for each item that has geometry.
|
||||
|
||||
#### Scenario: Route with geometry
|
||||
- **WHEN** the routes list page loads and a route has a `geom` column
|
||||
- **THEN** a small map thumbnail is rendered showing the route path
|
||||
- **AND** the map auto-fits to the route bounds
|
||||
|
||||
#### Scenario: Route without geometry
|
||||
- **WHEN** a route has no `geom` (legacy route)
|
||||
- **THEN** a placeholder is shown instead of a map thumbnail
|
||||
|
||||
#### Scenario: Activity with geometry
|
||||
- **WHEN** the activities list page loads and an activity has a `geom` column
|
||||
- **THEN** a small map thumbnail is rendered showing the activity path
|
||||
|
||||
### Requirement: Interactive map on detail pages
|
||||
Route and activity detail pages SHALL show an interactive read-only map with the route/activity drawn.
|
||||
|
||||
#### Scenario: Route detail with geometry
|
||||
- **WHEN** a user views a route detail page and the route has geometry
|
||||
- **THEN** a full-width interactive map is shown with the route path
|
||||
- **AND** the map has zoom controls and layer switching
|
||||
- **AND** the map auto-fits to the route bounds
|
||||
|
||||
#### Scenario: Activity detail with geometry
|
||||
- **WHEN** a user views an activity detail page and the activity has geometry
|
||||
- **THEN** a full-width interactive map is shown with the activity path
|
||||
|
||||
#### Scenario: Detail page without geometry
|
||||
- **WHEN** a route or activity has no geometry
|
||||
- **THEN** no map section is rendered
|
||||
Loading…
Add table
Add a link
Reference in a new issue