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

    Class Path

    Represents a path object.

    Index

    Constructors

    • Parameters

      • id: number

      Returns Path

    Accessors

    • get coordinates(): Coordinates[]

      Get read-only access to the internal coordinates list.

      Returns Coordinates[]

      The coordinates list

    • get name(): string

      Get path name.

      Returns string

      The path name

    • set name(name: string): void

      Set path name.

      Parameters

      • name: string

        The path name

      Returns void

    • get pointerId(): number

      Returns number

    • get wayPoints(): number[]

      Get read-only access to the internal waypoint list.

      Returns number[]

      The waypoint list

    Methods

    • Clone reverse order path. Does not change the original path.

      Returns Path

      The reversed path

    • Clone path from the given coordinates.

      Set start = end to create a circuit track.

      Parameters

      Returns Path

      The cloned path

    • Export path coordinates in the requested data format.

      Parameters

      Returns string

      The string with the exported data.

    • Create a new landmark list from a path.

      Returns Landmark[]

      The landmark list

    • Create a path from a data buffer of a given format.

      Parameters

      • params: { data: Uint8Array; format?: PathFileFormat }

        Object containing:

        • data: The data buffer.
        • format: The data format (optional).

      Returns Path

      The created path

    • Create a path from a list of coordinates.

      Parameters

      Returns Path

      The created path

    • Create a path from list of coordinates and waypoints.

      Parameters

      • params: { coordinates: Coordinates[]; waypoints: number[] }

        Object containing:

        • coordinates: List of coordinates.
        • waypoints: List of waypoints (indexes in the coordinates list).

      Returns Path

      The created path

    • Get a coordinate along the path given by a fraction of the path length between 0.0 (departure point) and 1.0 (destination).

      Parameters

      • coords: Coordinates[]

        The path coordinates list.

      • percent: number

        The size percent (fraction) in the range {0, 1}, e.g. 0.5 will return the coordinates of the point in the middle of the path.

      Returns Coordinates

      The coordinates at the given percent