Problem: sometimes you want to know whether you're looking at a stop for, say, the 66, and you want to know whether it is headed to Harvard or Dudley. You want this to fit in the space of one character ideally so it can go next to the name "66". You don't want "inbound" and "outbound" or "north/south/east/west" because those are not intuitive descriptors for many MBTA routes.
Use the vector from the current bus stop to the next stop on the route, and show that compass angle to the user as a rotated arrow. But don't use the very next stop, as that's too sensitive to small detours because of the street layout. Use a few stops after this one instead; use a vector from the stop to the position a few stops ahead of it. This could be saved in stops.js as an angle in degrees or radians, and then shown to the user next to the bus number as a compass-like arrow.
Complication: some routes, like the 66, have more than two directions. For the 66 this is because there are a few buses to transport school-children from Dudley to Brighton and back, which is important enough that the printed schedule lists which trips go to/from Brighton but not important enough for its map to show where in Brighton it goes exactly. For the 89, which goes to either Clarendon Hill or Davis Square, this is important enough that it is shown on the map, though in that case getting the direction based on the wrong route variation wouldn't be very confusing. Other strange routes include the 70/70A, the 72/75, ...
Problem: sometimes you want to know whether you're looking at a stop for, say, the 66, and you want to know whether it is headed to Harvard or Dudley. You want this to fit in the space of one character ideally so it can go next to the name "66". You don't want "inbound" and "outbound" or "north/south/east/west" because those are not intuitive descriptors for many MBTA routes.
Use the vector from the current bus stop to the next stop on the route, and show that compass angle to the user as a rotated arrow. But don't use the very next stop, as that's too sensitive to small detours because of the street layout. Use a few stops after this one instead; use a vector from the stop to the position a few stops ahead of it. This could be saved in stops.js as an angle in degrees or radians, and then shown to the user next to the bus number as a compass-like arrow.
Complication: some routes, like the 66, have more than two directions. For the 66 this is because there are a few buses to transport school-children from Dudley to Brighton and back, which is important enough that the printed schedule lists which trips go to/from Brighton but not important enough for its map to show where in Brighton it goes exactly. For the 89, which goes to either Clarendon Hill or Davis Square, this is important enough that it is shown on the map, though in that case getting the direction based on the wrong route variation wouldn't be very confusing. Other strange routes include the 70/70A, the 72/75, ...