Options
All
  • Public
  • Public/Protected
  • All
Menu

A polyline is defined by a number of ordered, connected Points. A polyline is always defined in a particular geographical reference (Geodetic reference or Grid Reference). A Polyline cannot be instantiated directly. It must be instantiated using createPolyline.

Hierarchy

Implements

Overview

Accessors

bounds

coordinateType

  • The coordinate type this shape. This property is read only. An Error will be thrown when trying to assign to this property.

    Returns CoordinateType

focusPoint

  • get focusPoint(): Point

pointCount

  • get pointCount(): number
  • The number of points in the polyline

    Returns number

reference

  • The spatial reference of this shape. This property is read only. An Error will be thrown when trying to assign to this property.

    Returns CoordinateReference | null

type

Methods

contains2D

  • Determines whether a given point is inside this shape. This method checks containment only in two dimensions: on the (x,y)-axis or the (lon,lat)-axis (depending on the spatial reference of the shape).

    throws

    InvalidReferenceError when passing a Point with another spatial reference

    deprecated

    Please use contains2DPoint instead.

    Parameters

    • x: Point | number | Bounds

      The point for which containment must be checked. If a 3D point is passed to this function, it will be treated as a 2D point: the z coordinate (height) will be ignored. The reference of this point must be the same reference as this Shape

    • Optional y: number

    Returns boolean

    true when the given point is contained in this shape

Abstract contains2DCoordinates

  • (x: number, y: number): boolean
  • Determines whether the given point is inside this shape. This method checks containment only in two dimensions: on the (x,y)-axis or the (lon,lat)-axis (depending on the spatial reference of the shape).

    throws

    InvalidReferenceError when passing a Point with another spatial reference

    Parameters

    • x: number

      The x coordinate of the point for which containment must be checked

    • y: number

      The y coordinate of the point for which containment must be checked

    Returns boolean

    true when the given point is contained in this shape

contains2DPoint

  • (point: Point): boolean
  • Determines whether the given point is inside this shape. This method checks containment only in two dimensions: on the (x,y)-axis or the (lon,lat)-axis (depending on the spatial reference of the shape).

    throws

    InvalidReferenceError when passing a Point with another spatial reference

    Parameters

    • point: Point

      The point for which containment must be checked.

    Returns boolean

    true when the given point is contained in this shape

Abstract copy

equals

  • (polyline: Shape): boolean

getPoint

  • Returns the point of the polyline at the given index. Any subsequent mutation on the point affects the polyline shape. Note: A new Point is returned on each function invocation that shares the same point representation of the polyline.

    const pA = polyline.getPoint(0)
    const pB = polyline.getPoint(0)
    console.log(pA === pB) // false
    pA.x = 100;
    console.log(pA.x, pB.x, polyline.getPoint(0).x) // 100, 100, 100

    Parameters

    • index: number

      The index of the point to be returned.

    Returns Point

insertPoint

  • (index: number, point: Point): void
  • Inserts a Point at a given position in this Polyline. The point must be defined in the same spatial reference as the polygon, otherwise an exception will be thrown.

    throws

    InvalidReferenceError When the point's spatial reference does not correspond with the polyline's spatial reference.

    throws

    ProgrammingError When the index is invalid (i.e. smaller than zero or larger than the amount of points in the polyline.

    Parameters

    • index: number

      The index at which the point must be inserted

    • point: Point

      The point to be inserted

    Returns void

move2DPoint

  • (index: number, x: number, y: number): void
  • Moves the x and y coordinates of the point at the given index to the given coordinates. The z value remains unchanged.

    throws

    ProgrammingError When the index is invalid (i.e. smaller than zero or larger than the index of the last point in the polyline.

    Parameters

    • index: number

      The index of the point that must be removed.

    • x: number

      x coordinate value

    • y: number

      y coordinate value

    Returns void

move3DPoint

  • (index: number, x: number, y: number, z: number): void
  • Moves the point at the given index to the given coordinates.

    throws

    ProgrammingError When the index is invalid (i.e. smaller than zero or larger than the index of the last point in the polyline.

    Parameters

    • index: number

      The index of the point that must be removed.

    • x: number

      x coordinate value

    • y: number

      y coordinate value

    • z: number

      z coordinate value

    Returns void

removePoint

  • (index: number): void
  • Removes a Point at a given position in this Polyline.

    throws

    ProgrammingError When the index is invalid (i.e. smaller than zero or larger than the index of the last point in the polyline.

    Parameters

    • index: number

      The index of the point that must be removed.

    Returns void

toString

  • (): string

translate

  • (x: number, y: number, z?: number): void
  • Translates all the points of this Polyline over the given vector in 2D or 3D space. A point is only translated in 3D space if the z parameter is specified.

    Parameters

    • x: number

      x coordinate value

    • y: number

      y coordinate value

    • Optional z: number

      z coordinate value, may be omitted.

    Returns void

translate2D

  • (x: number, y: number): void

translate3D

  • (x: number, y: number, z: number): void
  • Translates all the points of this Polyline over the given vector in 3D space.

    Parameters

    • x: number

      x coordinate value

    • y: number

      y coordinate value

    • z: number

      z coordinate value

    Returns void

translatePoint

  • (index: number, x: number, y: number, z: number): void
  • Translates the point at the given index over the given vector in 2D or 3D space. A point is only translated in 3D space if the z parameter is specified.

    throws

    ProgrammingError When the index is invalid (i.e. smaller than zero or larger than the index of the last point in the polyline.

    Parameters

    • index: number

      The index of the point that must be removed.

    • x: number

      x coordinate value

    • y: number

      y coordinate value

    • z: number

      z coordinate value, may be omitted.

    Returns void

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method