@@ -625,8 +625,10 @@ com.transitboard.hotel.prototype.getTripPlanOnly = function (dest) {
625
625
return ;
626
626
627
627
// We don't handle throughroutes yet (issue 43)
628
- if ( Number ( itin . find ( 'numberOfTripLegs' ) . text ( ) ) > 3 )
628
+ if ( Number ( itin . find ( 'numberOfTripLegs' ) . text ( ) ) > 3 ) {
629
629
console . log ( 'Too many trip legs, probably issue 43!' ) ;
630
+ return ;
631
+ }
630
632
631
633
// route 90 is an alternate number for MAX
632
634
var freqService = [ '4' , '6' , '8' , '9' , '12' , '14' ,
@@ -997,15 +999,21 @@ com.transitboard.hotel.prototype.getTransitGeometry = function (leg) {
997
999
* Get real time arrivals for a given stop and line
998
1000
* It is assumed that the headsign that is passed in is the same as the
999
1001
* one returned by the trip planning service. It is further assumed that the
1000
- * stopId is one that arrivals have been requested for; this function will
1001
- * return null (not undefined) if it is not.
1002
+ * stopId is one that arrivals have been requested for; no checking is
1003
+ * performed
1002
1004
* @param {string } stopId The stop ID arrivals are being requested for
1003
1005
* @param {string } route The route this vehicle is serving
1004
1006
* @param {string } headsign The headsign of the requested vehicle
1007
+ * @returns {arrivalsQueue } A queue of transit arrivals.
1005
1008
*/
1006
1009
com . transitboard . hotel . prototype . getRealTimeArrivals = function ( stopId ,
1007
1010
route ,
1008
1011
headsign ) {
1012
+ // TODO: order for efficiency?
1013
+ return this . realTimeArrivals . arrivalsQueue
1014
+ . byStop ( ) [ stopId ]
1015
+ . byLine ( ) [ route ]
1016
+ . byDest ( ) [ headsign ] ; // this really means byHeadsign
1009
1017
1010
1018
}
1011
1019
0 commit comments