mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-27 07:07:31 +00:00
feat(tours): show the known SAC grades along a hike (MAP-03)
A hike in the planner, being edited or viewed as an import, now has an "SAC grades" card. Switched on, it asks the router which OpenStreetMap ways lie under the line (matched on foot, every grade of path open) and the server reads their sac_scale through the Overpass mirrors, the same trail-grades read the mountain bike grades use. The grades are drawn along the route on the planner map in one ramp of a single hue, T1 to T6, and listed by share and length; a row draws its class alone. Each row names its source in a tooltip: the SAC hiking scale and the sac_scale value OpenStreetMap wrote. What is not known stays unknown and says why, never T1: a way without a grade, a grade that names no single step (handed on as written), a stretch with no way clearly under the tour's line, or a way that could not be asked about. For imported tracks and stretches drawn by hand a matched way only counts where it keeps within 25 m of the tour's own line, so the original line is kept and nothing is guessed. The router's own reading of the scale is not asked for, since it may be normalised. The routing limit of a planned hike sits apart as a setting with its own badge, and a known step above it is marked. Nothing about the tour, its places or its days changes; switched off, the map is as it was. No regional colour categories and no grade derived from slope, height or trail markings.
This commit is contained in:
@@ -1,17 +1,19 @@
|
||||
import { create } from 'zustand';
|
||||
|
||||
/**
|
||||
* BIK-01 to BIK-05, RUN-02: the stretches of the planned route a card points
|
||||
* at (a surface, a kind of way, a trail or hiking grade), drawn over the route
|
||||
* on the planner map in the colour of what they are. `paint` names a token of
|
||||
* the bike paints, resolved where the map is drawn, so the theme decides the
|
||||
* colour.
|
||||
* BIK-01 to BIK-05, RUN-02 and MAP-03: the stretches of the planned route a
|
||||
* card points at (a surface, a kind of way, a trail or hiking grade, a hike's
|
||||
* SAC grades), drawn over the route on the planner map in the colour of what
|
||||
* they are. `paint` names a token of the route paints (bike and hike),
|
||||
* resolved where the map is drawn, so the theme decides the colour.
|
||||
*/
|
||||
export interface RouteHighlight {
|
||||
/** What is pointed at, so its row can show it is on. */
|
||||
id: string;
|
||||
lines: [number, number][][];
|
||||
paint: string;
|
||||
/** One paint per line where the lines differ, as when every SAC grade is drawn at once; else `paint` for all. */
|
||||
paints?: readonly string[];
|
||||
}
|
||||
|
||||
interface TourRouteHighlightState {
|
||||
|
||||
Reference in New Issue
Block a user