Long routes took minutes to prepare (or appeared stuck) because of three
compounding costs, each now fixed:
- Overpass fetch: the query covered the route's whole bounding box, so a
long or diagonal route pulled every speed-limited road in a huge
rectangle. Replace it with an 'around' corridor query over a
downsampled route line (75 m spacing, capped at 700 points), so the
payload scales with route length, not bounding area. POST the query
(corridor strings outgrow GET URLs) with an explicit 30 s timeout so a
slow server can no longer stall route prep indefinitely — failures
fall back to profile/ETA pacing as before.
- Speed-limit matching: nearestSpeedLimit rescanned every OSM way
segment for every route segment (O(route x ways), tens of millions of
distance checks on long routes). Add RouteSpeedIndex, a grid-bucketed
spatial index (~440 m cells) probed via its 3x3 neighborhood; every
search radius is well below one cell, so results are unchanged. The
bus-stop approach check and the dwell snapping pass (previously
O(stops x samples)) use the same bucketing.
- Route densification: 10 m sampling made a 300 km route produce 30k+
points on the main thread. Sampling now widens adaptively past a 25k
point cap; playback interpolates per tick within segments anyway, so
smoothness is unaffected.
Previously only OSM nodes tagged highway=bus_stop were fetched and drawn,
which misses most stops in regions that use the newer public_transport
schema (platform / stop_position with bus=yes). Query and decode all of
these tag combinations so bus mode surfaces the full set of stops instead
of the sparse few tagged the legacy way.
The bus stops fetched from OpenStreetMap for bus-mode pacing/dwell were
only used to compute playback timing and never drawn. Surface them from
the prefetch result into view state and render them as orange bus markers
whenever the Bus speed profile is active.
- New toolbar menu on the location simulator map to switch between
Standard, Satellite, and Hybrid map types
- Traffic overlay toggle for Standard/Hybrid modes
- Points-of-interest mode: All Places, Transit Stops (surfaces bus
stops), or Hidden
- Selections persist across launches via AppStorage
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CUJbpUQiRUbjiTiYA4v7UK
Adds a SpeedProfile picker to route simulation with fixed paces for
walking, jogging, and cycling; road-speed-limit-based driving; a
capped bus profile that slows on approach to and dwells at Overpass
bus_stop nodes; and a custom km/h speed entered by the user. Also
extends OverpassResponse.Element with lat/lon so bus stop nodes
(which report coordinates directly rather than via geometry) can be
parsed.