Waze Map Editor JavaScript SDK
    Preparing search index...

    Class Turns

    Methods for dealing with Turns.

    Index

    Methods

    • Checks if the turns through the specified node can be edited.

      Parameters

      • args: { nodeId: number }
        • nodeId: number

          An id of the node to check edit permissions for.

      Returns boolean

      true if all the segments going through the node allow connections to be edited.

      DataModelNotFoundError in case the node is not found in the WME data model

    • Returns Turn[]

      an array of all the turns in the WME data model

    • Parameters

      • args: { turnId: string }
        • turnId: string

          An id of the turn to find.

      Returns null | Turn

      turn with id, or null if not found in the WME data model

    • Get all turns from the segment

      Parameters

      • args: { segmentId: number }
        • segmentId: number

          An id of the segment to find turns for.

      Returns Turn[]

      all turns from the segment

      DataModelNotFoundError in case the segment is not found in the WME data model

    • Get all known turns through the node.

      Parameters

      • args: { nodeId: number }
        • nodeId: number

          An id of the node to find turns for.

      Returns Turn[]

      an array of all known turns through the node

      DataModelNotFoundError in case the node is not found in the WME data model

    • Get all turns to the segment

      Parameters

      • args: { segmentId: number }
        • segmentId: number

          An id of the segment to find turns for.

      Returns Turn[]

      all turns to the segment

      DataModelNotFoundError in case the segment is not found in the WME data model

    • Determine if a turn is allowed between segments based on turn data

      Parameters

      • args: { fromSegmentId: number; nodeId: number; toSegmentId: number }
        • fromSegmentId: number

          An id of the first segment to find the turn by.

        • nodeId: number

          An id of the node to find the turn by.

        • toSegmentId: number

          An id of the second segment to find the turn by.

      Returns boolean

      true if a turn is allowed

      DataModelNotFoundError in case the node or any of the segments is not found in the WME data model

    • Determine if a turn is allowed between segments based on directions

      Parameters

      • args: { fromSegmentId: number; nodeId: number; toSegmentId: number }
        • fromSegmentId: number

          An id of the first segment to find the turn by.

        • nodeId: number

          An id of the node to find the turn by.

        • toSegmentId: number

          An id of the second segment to find the turn by.

      Returns boolean

      true if a turn is allowed

      DataModelNotFoundError in case the node or any of the segments is not found in the WME data model

    • Sets the number of lanes for segment turns in a given direction. Min is 0 and max is 32.

      Parameters

      • args: {
            laneCount: number;
            laneDirection: SegmentLaneGuidanceDirection;
            segmentId: number;
        }
        • laneCount: number

          The new turns lane count.

        • laneDirection: SegmentLaneGuidanceDirection

          The direction of the segment where the laneCount is to be updated.

        • segmentId: number

          An id of the segment the turns belong to.

      Returns void

      DataModelNotFoundError in case the segment is not found in the WME data model

      InvalidStateError in case the lane direction is not allowed for the segment

    • Sets lane guidances for a given turn. laneIndexes enables the turn for the lanes at the provided indexes. When a lane index is not provided, the turn is disabled instead. For example, laneIndexes: [1, 2] enables the turn for lanes 2 and 3 but disables for lane 1. Min index is 0, max is laneCount - 1.

      Parameters

      • args: { laneIndexes: number[]; turnId: string }
        • laneIndexes: number[]

          An array of indexes of the lanes to be enabled.

        • turnId: string

          An id of the turn.

      Returns void

      DataModelNotFoundError in case the turn is not found in the WME data model

      InvalidStateError in case the turn is not allowed to be updated

      InvalidStateError in case the lane count is not set

      InvalidStateError some turns are conflicting

    • Update turn by id.

      Parameters

      • args: { isAllowed?: boolean; turnId: string }
        • OptionalisAllowed?: boolean

          If turn is allowed or not.

        • turnId: string

          An id of the turn to update.

      Returns void

      DataModelNotFoundError in case the turn is not found in the WME data model

      InvalidStateError if no attribute to update was provided or if not allowed to update the turn