Skip to content

Train widget: the app's own train map instead of the old diagram - #14

Merged
intelarc merged 2 commits into
mainfrom
claude/new-session-mvz2ww
Sep 26, 2026
Merged

intelarc merged 2 commits into
mainfrom
claude/new-session-mvz2ww

Conversation

@intelarc

Copy link
Copy Markdown
Owner

The Ngā Tereina widget now shows the same map as the Trains tab's Diagram view, instead of the old schematic.

  • New TrainArt: renders the map off screen at the widget's size with MapLibre's MapSnapshotter. The map runs edge to edge under a shaded header. It shows:
    • the quiet dark basemap
    • the lines along their real tracks, side by side where they share rails
    • station dots, platform bars and ranked names
    • every train snapped to its own line, with a late dot when it's running late
  • Shared with the app:
    • drawLayers is split into aklLayers / aklData
    • the line and station building moves into TrainNet.lines / TrainNet.stopsAndLinks
    • so the widget and the Trains tab draw from the same code
  • Real tracks cached: TrainNet.geo(ctx) saves the real tracks to rail-track.txt, so the widget can draw them when the timetable isn't loaded.
  • Fallback: if the map can't be drawn, the widget falls back to the old diagram.

🤖 Generated with Claude Code

https://claude.ai/code/session_011C2fAvFFcMRkaF7qSvRA1v


Generated by Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011C2fAvFFcMRkaF7qSvRA1v
The widget now draws the same map as the Trains tab's Diagram view, off
screen at the widget's size: the quiet dark map, the lines along their
real tracks side by side, the stations and names, and every train on its
own line. The map layers and the line/station building are shared with
the app, and the real tracks are kept on the phone so the widget can draw
them when the timetable isn't loaded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011C2fAvFFcMRkaF7qSvRA1v
@intelarc
intelarc merged commit 6c8f902 into main Sep 26, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants