docs: document preferences dialog, default-unchecked layers, robust routing + turn-by-turn
All checks were successful
CI / test-and-build (push) Successful in 42s

This commit is contained in:
hermes-explorigin 2026-08-10 13:12:55 +00:00
parent d786ee3151
commit 149d7942dd

View File

@ -66,7 +66,8 @@ static/data/
The frontend loads `/data/_index.json`, then fetches each layer's GeoJSON and The frontend loads `/data/_index.json`, then fetches each layer's GeoJSON and
renders it as a toggleable overlay with a legend (top-right). Every layer can be renders it as a toggleable overlay with a legend (top-right). Every layer can be
shown/hidden independently. shown/hidden independently. **By default no layers are shown on load** — toggle the
ones you want from the legend.
## OSM Data-Dump Ingestion (`osm-dump.mjs`) ## OSM Data-Dump Ingestion (`osm-dump.mjs`)
@ -221,6 +222,12 @@ The matcher:
matches still hit (e.g. `philbrick` finds `Philbrook`). matches still hit (e.g. `philbrick` finds `Philbrook`).
- Ranks name matches above address matches above description matches. - Ranks name matches above address matches above description matches.
## Preferences & Units
Click **⚙ Preferences** in the top bar to choose **Metric** or **Imperial** units.
Your choice (and the granular unit override) is saved to `localStorage`, so it
persists across reloads and is shared by the Directions panel.
## Directions & Routing ## Directions & Routing
When a dump layer is present (it carries the routable graph), a **Directions** When a dump layer is present (it carries the routable graph), a **Directions**
@ -235,6 +242,13 @@ button appears in the top bar. Opening it lets you:
large one for long routes), plus a **travel mode** (Drive or Walk). large one for long routes), plus a **travel mode** (Drive or Walk).
- See the route's **distance** and an **estimated travel time** (computed from - See the route's **distance** and an **estimated travel time** (computed from
the mode's average speed). the mode's average speed).
- **Turn-by-turn directions** (*Head north*, *Turn right*, *Arrive at destination*,
…) are generated for **Drive** mode and listed beneath the result; a live
progress bar shows while the route computes.
- **Robustness:** if A/B are far from the routable road network, or the destination
is disconnected / fully blocked by avoided categories, the app reports *why* and
still draws the **closest reachable** portion of a route (flagged as a partial
path) instead of failing silently.
Routing is done **entirely in the browser** (`src/lib/routing.ts`): an Routing is done **entirely in the browser** (`src/lib/routing.ts`): an
A*-search over the graph built from the OSM dump. Point A/B are snapped to the A*-search over the graph built from the OSM dump. Point A/B are snapped to the
@ -248,6 +262,10 @@ const r = route(graph, [latA, lonB], [latB, lonB], pois, [
{ category: 'amenity', value: 'school', radiusM: 300, block: true } { category: 'amenity', value: 'school', radiusM: 300, block: true }
]); ]);
// r.found, r.path ([[lat,lon],...]), r.distanceM // r.found, r.path ([[lat,lon],...]), r.distanceM
// r.partial (best-effort partial route when the destination is unreachable),
// r.fromSnapM / r.toSnapM (distance from A/B to nearest road),
// r.reason (human explanation when no full route exists),
// r.turns (turn-by-turn steps for driving mode)
``` ```
## Deployment ## Deployment