Home > @magiclane/maps-sdk > TrafficService

TrafficService class

Traffic service. Adds support to update traffic information.

Signature:

export declare class TrafficService 

Properties

Property

Modifiers

Type

Description

persistentRoadblockListener

static

PersistentRoadblockListener

Set persistent roadblocks listener

persistentRoadblocks

static

readonly

TrafficEvent[]

Get all persistent user roadblocks

preferences

static

readonly

TrafficPreferences

Gets access to the traffic service preferences.

transferStatistics

static

readonly

TransferStatistics

Gets data transfer statistics for this service.

Methods

Method

Modifiers

Description

addAntiPersistentRoadblockByArea(params)

static

Add a user persistent anti-area roadblock to collection.

addPersistentRoadblockByArea(params)

static

Add a user persistent roadblock to collection (area impact zone type).

addPersistentRoadblockByCoordinates(params)

static

Add a user persistent roadblock to collection (path impact zone type).

If params.coords size == 1, a point located roadblock is defined - this may result in 2 real roadblocks for matched road both ways. If params.coords size > 1, a path located roadblock is defined - this will result in 1 map roadblock in start -> end way.

getOnlineServiceRestrictions(coords)

static

Gets the online traffic service restrictions for the given position

getPersistentRoadblock(id)

static

Get an user persistent roadblock identified by id

getPersistentRoadblockPathPreview(params)

static

Get persistent roadblock path preview.

removeAllPersistentRoadblocks()

static

Remove all user persistent roadblock

removePersistentRoadblockByCoordinates(coords)

static

Remove an user persistent roadblock identified by a reference coordinate ( for path impact zone type )

removePersistentRoadblockById(id)

static

Remove an user persistent roadblock identified by id

removeUserRoadblock(event)

static

Remove an user roadblock ( persistent or non-persistent )