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

(constructor)({ route, agency, tripIndex, tripDate, hasRealtime, departureTime, isCancelled, delayMinutes, stopTimes, stopIndex, stopPlatformCode, isWheelchairAccessible, isBikeAllowed, alerts, vehicle, departureOccupancyStatus, }, input)

Create a PTTrip.

API users do not typically create instances of this class directly.

Properties

Property

Modifiers

Type

Description

agency

PTAgency

The agency operating the trip.

alerts

readonly

PTAlertInfo[]

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.

delayMinutes?

number

(Optional) Delay in minutes (may be null).

departureOccupancyStatus?

PTOccupancyStatus

(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.

departureTime?

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.

hasRealtime

boolean

Whether realtime information is available.

isBikeAllowed

boolean

Indicates whether bikes are allowed on the trip.

isCancelled?

boolean

(Optional) Optional cancellation flag.

isWheelchairAccessible

boolean

Wheelchair accessibility flag.

route

PTRouteInfo

The route associated with the trip.

stopIndex

number

Index of the current/selected stop within stopTimes.

stopPlatformCode?

string

(Optional) Platform code for the stop (may be null).

stopTimes

PTStopTime[]

The list of stop times for this trip.

tripDate?

readonly

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.

tripIndex

readonly

number

Internal trip index.

vehicle?

PTCrowdingInfo

(Optional) Live crowding of the vehicle running exactly this trip instance. Undefined when no fresh vehicle position reports it (upcoming departures usually have none).