Home > @magiclane/maps-sdk > PTTrip
PTTrip class
A scheduled public transport trip instance.
Represents a single scheduled run of a route with times, delays, cancellation and accessibility metadata.
Maps & 3D Scene
Signature:
export declare class PTTrip Constructors
Constructor | Modifiers | Description |
|---|---|---|
Create a PTTrip. API users do not typically create instances of this class directly. |
Properties
Property | Modifiers | Type | Description |
|---|---|---|---|
The agency operating the trip. | |||
| Service alerts applicable to this departure. Shared instances from PTStopInfo.alerts; empty when none apply. Note: a NoService alert overlaps with PTTrip.isCancelled - isCancelled remains the authoritative "don't ride this" flag; the alert supplies the user-facing reason. | ||
number | (Optional) Delay in minutes (may be null). | ||
(Optional) PREDICTED occupancy after departing this stop (GTFS-RT departure_occupancy_status). Prefer the live PTTrip.vehicle value for the current vehicle, this one for upcoming departures. Undefined when the feed supplies none. | |||
Date | (Optional) Departure time (UTC flag, local value). **WARNING:** Returned as a Date with UTC flag but representing local time; use TimezoneService to convert if needed. | ||
boolean | Whether realtime information is available. | ||
boolean | Indicates whether bikes are allowed on the trip. | ||
boolean | (Optional) Optional cancellation flag. | ||
boolean | Wheelchair accessibility flag. | ||
The route associated with the trip. | |||
number | Index of the current/selected stop within stopTimes. | ||
string | (Optional) Platform code for the stop (may be null). | ||
The list of stop times for this trip. | |||
| Date | (Optional) Trip date (UTC flag, local value). **WARNING:** Returned as a Date with UTC flag but representing local time; use TimezoneService to convert if needed. | |
| number | Internal trip index. | |
(Optional) Live crowding of the vehicle running exactly this trip instance. Undefined when no fresh vehicle position reports it (upcoming departures usually have none). |