mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-03 01:28:55 +00:00
03d6457bde
PAD-05B: a click on an obstacle on the map or on the route band opens its card in the look of the via ferrata card: the kind with its glyph, the name, how it stands to the route (on it at a distance along it, near it with the link marked unclear, or only in the area), the paddling rule its tags give with canoe read before boat, a condition as written, height, grade, hours and fees, the source with the date of the data and the OpenStreetMap link. A missing rule reads as unknown, never as allowed, and a portage way recorded as private says so. Objects only in the area show from zoom 13 on, on Leaflet and GL alike; on GL the lines only near the route are dashed as on Leaflet, one click handler picks the marker over the line, and a picked marker no longer flickers. The route band marks the obstacles on and near the route by their share of the measured line. The obstacle notice also names an answer cut at its limit. PAD-05A: the admin area gets a Paddle water data card under the addons, on desktop and phone: a search in Geofabrik's list with each region's path, the regions with their state (waiting, reading with its progress, ready with objects and data date, failed with the reason), reading again and removing after a confirmation. The list follows a read without reloading. Region changes write audit rows. Map colours of paddle objects and portages come from theme tokens read at draw time, as the via ferratas do; the ferrata layer now shares that reader. The rail takes the planner page's parts as one bag, the map hit tests of the tour layers are one helper, and the unused noWaterData string is gone from every locale.
41 lines
1.5 KiB
TypeScript
41 lines
1.5 KiB
TypeScript
import { readMapPaint, sameMapPaint } from '../Map/mapPaint';
|
|
|
|
/**
|
|
* The colours the via ferrata lines are drawn in.
|
|
*
|
|
* Ferratas have a look of their own: a dashed violet line on a white halo.
|
|
* Violet is the one colour nothing else on the planner map uses (the route is
|
|
* blue, its grades run green to red, the waypoints are blue), and the halo
|
|
* keeps it readable over a satellite tile or dark hillshade. The ferrata under
|
|
* the pointer or open in the card is drawn solid, wider and in a deeper violet.
|
|
* The grade is a badge on the card, never a line colour.
|
|
*
|
|
* Map paint cannot take a `var(--token)`: Leaflet writes the colour into an
|
|
* SVG `stroke` attribute and GL paint wants a resolved colour string. So the
|
|
* `--map-ferrata*` tokens are read off the document when the layer draws
|
|
* (`mapPaint.ts`; the precedent is the hazard overlay in useHazardLayerGL),
|
|
* which keeps light and dark mode apart without a colour literal in the layer.
|
|
*/
|
|
export interface FerrataPaint {
|
|
/** The dashed line itself. */
|
|
line: string;
|
|
/** The halo under the line, so it stays readable over a satellite or hillshade tile. */
|
|
casing: string;
|
|
/** The ferrata under the pointer or open in the card. */
|
|
highlight: string;
|
|
}
|
|
|
|
export const FERRATA_TOKENS = {
|
|
line: '--map-ferrata',
|
|
casing: '--map-ferrata-casing',
|
|
highlight: '--map-ferrata-lit',
|
|
} as const;
|
|
|
|
export function ferrataPaint(): FerrataPaint {
|
|
return readMapPaint(FERRATA_TOKENS);
|
|
}
|
|
|
|
export function sameFerrataPaint(a: FerrataPaint, b: FerrataPaint): boolean {
|
|
return sameMapPaint(a, b);
|
|
}
|