MPPolygon is a collection of MPPoints that combine to form a single geographical area with a single body.

Export

Hierarchy

Constructors

  • Private

    Creates an instance of MPPolygon.

    Parameters

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

    Returns MPPolygon

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#polygon

    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.

    Returns Promise<number>

    Async

  • Parses the object to a JSON object that is compatible with the MapsIndoors SDK.

    Returns MPPolygonParams

  • Stringifies the geometry to JSON.

    Returns string

  • Creator for MPPolygon, used to decode JSON from the MapsIndoors SDK.

    Parameters

    Returns MPPolygon

    Static

Generated using TypeDoc