What’s New in the Transit Tracker
Huge changes are coming to the transit tracker! Before now I haven’t really tracked versions and this rewrite is substantial enough to say that this will be transit tracker 1.0!
Because this rewrite is so substantial I am releasing it first as a public beta at beta.transit.ucop.me. I am looking for feedback and issues. Please submit feedback here and issues here.
The transit tracker is open source, check it out on github.
Performance Boost: Going Fully Static
This release contained a huge performance boost that also required an overhaul to the visual style.
I made the app entirely static. I think the technical details are really cool but I will try not to bore you with them too much. The bottom line is that now when you access any page on the website your phone and the server don’t need to do any work. You get a complete web page delivered instantly! This cuts down load times by a lot and makes the app more responsive across the board. Your phone also has to do less work.
I had to revamp the style because before I was using a style library that depended on the dynamic website.
Tech stuff (skip if you want): Originally this was a Next.js app. However, our server gets updates from GPMetro’s GTFS feed and never saves anything from the user. This means we get every change we will ever need to make to any of our pages from a single predictable stream of events. We can actually rebuild every single page in the entire application including JSON for API responses for live updates on the page every time we get an update from GPMetro’s GTFS feed (every five seconds). When you navigate to the page for a stop you just get the page that we have already built in the background. If you refresh the page for a stop manually you actually can use our tracker without JavaScript enabled at all.
Map Performance and Quality Boost: Vector Maps
This release improves map loading experience significantly and improves readability. Previously, the map was made of tiled pictures and the bus stops, lines, and vehicles were drawn in on top. This caused the lines and stops to load in separately after the map. It also placed lines on top of labels for street names. The new version sends the map information to your phone so it draws the map, instead of positioning pictures and drawing items on top. It also does this using a more powerful graphics library in your browser (webGL). This also allows bus lines to go below other map elements. It solves some issues (like deciding when and where to render stops) to be computed in advance to prevent your phone from doing as much work.
Better Transit Map with Loom
Several of our bus lines run on top of one another, which is great for service frequency but hard to visually display. Before this release, the routes were displayed on the map as slightly transparent and overlapped each other. This made it tough to tell which routes were overlapping because the colors mixed together usually producing a sort of grey. Loom is an open sourced tool that takes in route shapes from GTFS and produces a nice transit map with lines next to each other from them.
Bug Fixes
Fixed a bug that caused some headsigns (the direction a bus is going) to be missing. These headsigns were missing from the GPMetro side but I added a feature that fills them in with the last stop in the line if they are missing.
Fixed a bug with missing buses specifically at Pulse. Buses like the 4 at Pulse were getting filtered out because the way they lingered at the stop instead of immediately departing which registered as an error, hiding the scheduled stop.
Fixed confusing behavior with trip start/stop that made it appear that there were double arrivals. Some trips end at a stop and then a trip immediately starts again. For example, the 9A and 9B loop but technically this is two trips that start and end at City Hall. The arrival of the end of one trip and the departure at the start of the next would both show up. I removed these extra arrivals.
Support Us
Like this work and want to see more like it? Consider donating. Building this is a volunteer effort but servers still cost money.