A multiPolygon is a collection of MPPolygons that combine to form a single geographical area with multiple bodies.

Export

Hierarchy

Constructors

  • Private

    Creates an instance of MPMultiPolygon.

    Parameters

    • _coordinates: number[][][][]
    • _bbox: number[]

    Returns MPMultiPolygon

Properties

_area?: number

area cache.

_bbox: number[]
_bounds?: MPBounds

bounds cache.

_coordinates: number[][][][]
multiPolygon: string = "MultiPolygon"

Typename for MPMultiPolygon.

Static

point: string = "Point"

Typename for MPPoint.

Static

polygon: string = "Polygon"

Typename for MPPolygon.

Static

Accessors

  • get bounds(): MPBounds
  • Get the polygon's bounds. If bbox is present then that will be used.

    Returns MPBounds

  • get position(): MPPoint
  • Get the position of the polygon, which is roughly its center.

    Returns MPPoint

  • get type(): string
  • Get the type of the polygon. see MPGeometry#multiPolygon

    Returns string

Methods

  • Private

    Clears area and bounds cache due to geometry recalculation.

    Returns void

  • Checks whether a point is contained within the geometry.

    Parameters

    Returns Promise<boolean>

    Async

  • Calculates the squared distance from the point to the closest edge in the polygon.

    Parameters

    Returns Promise<number>

    Async

  • Get the polygon's area, this is the combined area of all the polygons in the multi-polygon.

    Returns Promise<number>

    Async

  • Stringifies the geometry to JSON.

    Returns string

Generated using TypeDoc