Nicer Lines and Stops #142

Merged
maxtkc merged 6 commits from 140-nicer-marker-styles into main 2026-07-17 08:58:55 +00:00
Owner

Not the perfect solution, but looks a heck of a lot better than it did before.

Closes #140

Not the perfect solution, but looks a heck of a lot better than it did before. Closes #140
maxtkc self-assigned this 2026-07-17 08:58:47 +00:00
Give routes a cased look (darker outline under the colored line),
zoom-interpolated widths/stop radii, and a spotlight treatment for
selection: non-matching routes dim and their stops hide, while the
selected route's stops stay visible and clickable at any zoom.
Route stops are derived from trips/stop_times via a new
getStopIdsForRoute. stops-clickarea is now the sole hit-test layer,
collapsing to zero radius for stops hidden by the low-zoom fade so
invisible stops can't be hovered or clicked.
highlightStop and highlightAgencyRoutes dimmed non-matching route lines
via routeRenderer.highlightRoutes but never revealed the matching
routes' stops, unlike highlightRoute. Route a single applySpotlight()
through all entry points so line dimming and stop reveal always move
together, and track the active spotlight so it survives a basemap
change regardless of which focus type produced it (previously only
route-focus was restored).

Also move the route->stops lookup out of MapController and into
GTFSParser as getStopIdsForRoute, backed by a new stop_times/trip_id
index (mirroring the existing stop_id index) instead of a full
stop_times scan per click.
Move stop fade zoom range and spotlight dim/bump factors from
private module consts in layer-manager.ts and route-renderer.ts
into CONFIG so the fade-opacity expression and click-area hit
radius can't drift out of sync, and extract a shared
specialOrDim() helper to dedupe the inline spotlight-dim
expression in setRouteStops.
flyToRoute and fitToRoutes each re-derived a route's stop set via manual
unindexed trips/stop_times scans, duplicating GTFSParser.getStopIdsForRoute
which already does this correctly with an indexed lookup and route_id
coercion. Both now call the shared method instead.

Findings #1/#2 from code_review.md (single spotlight owner) were verified
already resolved by the existing MapController.applySpotlight design.
Replace ['stops-clickarea'].forEach(...) hover-handler wrappers in
interaction-handler.ts and layer-manager.ts with direct map.on() calls,
and extract the repeated focused feature-state expression in
addStationDotLayer to match addStopsBackgroundLayer's pattern.
maxtkc merged commit 1206c8589f into main 2026-07-17 08:58:55 +00:00
maxtkc deleted branch 140-nicer-marker-styles 2026-07-17 08:58:55 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gtfs.zone/coloring-book!142
No description provided.