Home > @magiclane/maps-sdk > TrafficEvent

TrafficEvent class

Traffic events class

Signature:

export declare class TrafficEvent extends GemAutoreleaseObject 

Extends: GemAutoreleaseObject

Constructors

Constructor

Modifiers

Description

(constructor)(id, mapId)

Constructs a new instance of the TrafficEvent class

Properties

Property

Modifiers

Type

Description

_mapId

protected

number

_pointerId

protected

number | bigint

affectedTransportModes

readonly

number

Gets affected transport modes as a bitfield

area

readonly

GeographicArea

Gets the geographic area associated with the event

boundingBox

readonly

RectangleGeographicArea

Gets the bounding box of the traffic event.

delay

readonly

number

Gets the estimated delay in seconds caused by the traffic event.

description

readonly

string

Gets the traffic event description

endTime

readonly

Date | null

Gets end time (UTC)

eventClass

readonly

TrafficEventClass

Gets the traffic event class

eventSeverity

readonly

TrafficEventSeverity

Gets the traffic event severity

hasOppositeSibling

readonly

boolean

Checks if event has a sibling on opposite direction

img

readonly

Img

Gets the traffic event image

impactZone

readonly

TrafficEventImpactZone

Gets the traffic event impact zone

isActive

readonly

boolean

Checks if this event is currently active

isAntiArea

readonly

boolean

Checks if this area-based event is an anti-area

isExpired

readonly

boolean

Checks if this event has expired

isRoadblock

readonly

boolean

Checks if this traffic event is a roadblock.

isUserRoadblock

readonly

boolean

Return true if the traffic event is a user roadblock

length

readonly

number

Gets the length in meters of the road segment affected by the traffic event.

mapId

readonly

number

pointerId

readonly

number | bigint

previewUrl

readonly

string

Gets the traffic event preview URL

referencePoint

readonly

Coordinates

Gets the traffic event reference point

startTime

readonly

Date | null

Gets start time (UTC)

Methods

Method

Modifiers

Description

cancelGetPreviewData(listener)

Cancel the preview data request

dispose()

getImage(size, format, allowResize)

Gets the traffic event image

getPreviewData(onResult)

Gets the traffic event preview data

init(id, mapId)

static