Home > @magiclane/maps-sdk > PTAlertInfo

PTAlertInfo class

GTFS-RT service alert.

A single deduplicated list of alerts is carried per response (PTStopInfo.alerts); trips and stops reference the shared instances (PTTrip.alerts, PTStop.alerts). Absent and empty are equivalent - alerts appear only when the server has realtime alerts enabled and something applies.

Maps & 3D Scene

Signature:

export declare class PTAlertInfo 

Constructors

Constructor

Modifiers

Description

(constructor)({ cause, effect, activePeriods, urls, headerTexts, descriptionTexts, severityLevel, causeDetails, effectDetails, }, input)

Create a PTAlertInfo.

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

Properties

Property

Modifiers

Type

Description

activePeriods

readonly

PTAlertActivePeriod[]

Active periods. Empty = active as long as the feed carries the alert.

cause

readonly

PTAlertCause

Alert cause. Out-of-range feed values map to UnknownCause.

causeDetails

readonly

PTAlertTranslation[]

Agency-specific cause wording translations (may be empty).

descriptionTexts

readonly

PTAlertTranslation[]

Description text translations (may be empty).

effect

readonly

PTAlertEffect

Alert effect. Out-of-range feed values map to UnknownEffect.

effectDetails

readonly

PTAlertTranslation[]

Agency-specific effect wording translations (may be empty).

headerTexts

readonly

PTAlertTranslation[]

Header text translations (may be empty).

severityLevel?

readonly

PTAlertSeverityLevel

(Optional) Alert severity; undefined when the feed supplies none.

urls

readonly

PTAlertTranslation[]

URL translations (may be empty).

Methods

Method

Modifiers

Description

causeDetailFor(language)

Cause detail for the given language (see PTAlertInfo.selectTranslation()).

descriptionTextFor(language)

Description text for the given language (see PTAlertInfo.selectTranslation()).

effectDetailFor(language)

Effect detail for the given language (see PTAlertInfo.selectTranslation()).

headerTextFor(language)

Header text for the given language (see PTAlertInfo.selectTranslation()).

selectTranslation(translations, language)

static

Select the best translation for a language.

Exact match on language, else the first entry; undefined when the list is empty.

urlFor(language)

URL for the given language (see PTAlertInfo.selectTranslation()).