Options
All
  • Public
  • Public/Protected
  • All
Menu

A polygon that can have a number of holes. A complex polygon should be created using createComplexPolygon. A ComplexPolygon is defined as an array of Polygon instances. The first polygon - at index 0- specifies the outer ring. All the other polygons are the holes.

Hierarchy

Implements

Overview

Constructors

Private constructor

  • This class should not be instantiated by users of LuciadRIA.

    Returns ComplexPolygon

Accessors

bounds

coordinateType

focusPoint

  • get focusPoint(): Point | null

polygonCount

  • get polygonCount(): number
  • The number of polygons in this ComplexPolygon

    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

addPolygon

  • Adds a polygon at the end of this complex polygon.

    throws

    InvalidReferenceError if the polygon's spatial reference does not match this complex polygon's spatial reference.

    Parameters

    • polygon: Polygon

      The polygon to add.

    Returns void

  • Adds a polygon at the specified index of this complex polygon.

    throws

    InvalidReferenceError if the polygon's spatial reference does not match this complex polygon's spatial reference.

    Parameters

    • index: number

      the index at which to insert a polygon, must be between 0 and the number of polygons in this complex polygon. If the index is 0, the polygon is the outer ring which must enclose all other polygons. Is the index a higher number, the polygon is a hole.

    • polygon: Polygon

      The polygon to insert when the first parameter is an index.

    Returns void

addPolygons

  • Adds one or more polygons to this complex polygon.

    throws

    InvalidReferenceError if any of the polygon's spatial reference does not match this complex polygon's spatial reference.

    Parameters

    • polygons: Polygon[]

      the polygons to add

    Returns void

clearPolygons

  • (): void
  • Removes all polygons from this complex polygon. This method will remove both the exterior ring as well as the inner rings.

    Returns void

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

contains2DCoordinates

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

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

copy

equals

  • (otherComplexPolygon: Shape): boolean

getPolygon

  • Get a polygon from this ComplexPolygon

    Parameters

    • index: number

    Returns Polygon

    The polygon at the requested index, or undefined if the index is larger than polygonCount

polygonChanged

  • (polygonOrIndex: Polygon | number): void
  • Notifies this complex polygon that the given polygon (or the polygon at the specified index) has changed.

    Parameters

    • polygonOrIndex: Polygon | number

      the polygon (or index of the polygon) that changed

    Returns void

removePolygon

  • Removes the polygon at the specified index from this complex polygon.

    Parameters

    • index: number

      the index of the polygon that should be removed that should be removed itself

    Returns Polygon | null

    the removed polygon

  • Removes a specific polygon from this complex polygon.

    Parameters

    • polygon: Polygon

      the polygon that should be removed that should be removed itself

    Returns Polygon | null

    the removed polygon

removePolygons

  • Removes one or more polygons to this complex polygon.

    Parameters

    • polygons: Polygon[]

      the polygons to remove

    Returns void

setPolygon

  • Replaces the polygon at the given index with the specified polygon.

    throws

    InvalidReferenceError if the polygon's spatial reference does not match this complex polygon's spatial reference.

    Parameters

    • index: number

      the index of the polygon to set. The index value must fall in the valid index range: 0 <= index < {number of polygons in the ComplexPolygon}. If this index equals 0, than the polygon must be the outerring, enclosing all the holes. If it is higher, than the polygon must be a hole.

    • polygon: Polygon

      the polygon to set

    Returns Polygon

toString

  • (): string

translate2D

  • (x: number, y: number): void
  • Translates all the polygons in this complex polygon over the given vector in 2D space.

    Parameters

    • x: number

      x coordinate value

    • y: number

      y coordinate value

    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