@magiclane/maps-sdk
    Preparing search index...

    Class TrafficService

    Traffic service. Adds support to update traffic information.

    Index

    Constructors

    Accessors

    • get persistentRoadblocks(): TrafficEvent[]

      Get all persistent user roadblocks

      Returns TrafficEvent[]

      The list of persistent user roadblocks

    Methods

    • Add a user persistent anti-area roadblock to collection.

      Parameters

      • params: {
            area: GeographicArea;
            expireTime: Date;
            id: string;
            startTime: Date;
            transportMode: RouteTransportMode;
        }

        The roadblock parameters.

        • area: GeographicArea

          The geographic area not affected by the roadblock, i.e. the anti-area (world wide - area) is the roadblock.

        • expireTime: Date

          The roadblock expire time.

        • id: string

          The user roadblock id. Can be used to get / delete a defined roadblock.

        • startTime: Date

          The roadblock start time.

        • transportMode: RouteTransportMode

          The transport mode for which the roadblock applies.

      Returns Pair<TrafficEvent | null, GemError>

      The TrafficEvent object and GemError.success if successful, or null with error code if failed.

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

      Parameters

      • params: {
            area: GeographicArea;
            expireTime: Date;
            id: string;
            startTime: Date;
            transportMode: RouteTransportMode;
        }

        The roadblock parameters.

        • area: GeographicArea

          The geographic area affected by the roadblock.

        • expireTime: Date

          The roadblock expire time.

        • id: string

          The user roadblock id. Can be used to get / delete a defined roadblock.

        • startTime: Date

          The roadblock start time.

        • transportMode: RouteTransportMode

          The transport mode for which the roadblock applies.

      Returns Pair<TrafficEvent | null, GemError>

      The TrafficEvent object and GemError.success if successful, or null with error code if failed.

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

      Parameters

      • params: {
            coords: Coordinates[];
            expireTime: Date;
            id: string;
            startTime: Date;
            transportMode: RouteTransportMode;
        }

        The roadblock parameters.

        • coords: Coordinates[]

          The roadblock coordinates list.

        • expireTime: Date

          The roadblock expire time.

        • id: string

          The user roadblock id. Can be used to get / delete a defined roadblock.

        • startTime: Date

          The roadblock start time.

        • transportMode: RouteTransportMode

          The transport mode for which the roadblock applies.

      Returns Pair<TrafficEvent | null, GemError>

      The TrafficEvent object and GemError.success if successful, or null with error code if failed.

    • Get an user persistent roadblock identified by id

      Parameters

      • id: string

        The roadblock id as it was provided in addPersistentRoadblock function

      Returns TrafficEvent | null

      The roadblock if found, null otherwise

    • Remove all user persistent roadblock

      Returns void

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

      Parameters

      • coords: Coordinates

        The roadblock start coordinates. Must be equal with first coordinate in coords list provided when the roadblock was defined

      Returns GemError

      GemError.success on success, GemError.notFound if the roadblock does not exist

    • Remove an user persistent roadblock identified by id

      Parameters

      • id: string

        The roadblock id as it was provided in addPersistentRoadblock function

      Returns GemError

      GemError.success on success, GemError.notFound if the roadblock does not exist

    • Remove an user roadblock ( persistent or non-persistent )

      Parameters

      Returns void