IBasePolygonGeometry

Extends IBaseGeometry, IPolygonGeometryAccess.

Interface for the "Polygon" geometry.

Constructor | Fields | Events | Methods

Constructor

IBasePolygonGeometry()

Fields

Name

Type

Description

events

IEventManager

Event manager.

Inherited from IEventEmitter.

Events

Name

Description

change

Changed coordinates. Instance of the Event class. Names of fields that are available via the Event.get method:

  • oldCoordinates - Old coordinates
  • newCoordinates - New coordinates.
  • oldFillRule - Old fill rule.
  • newFillRule - New fill rule.

Inherited from IPolygonGeometryAccess.

Methods

Name

Returns

Description

contains(position)

Boolean

Checks whether the passed point is located inside the polygon.

Inherited from IPolygonGeometryAccess.

freeze()

IFreezable

Switches the object to "frozen" mode.

Inherited from IFreezable.

get(index)

Number[][]

Returns coordinates of the contour with the specified index.

Inherited from IPolygonGeometryAccess.

getBounds()

Number[][]|null

Returns coordinates of the two opposite corners of the area that surrounds the geometry. The first item in the array is the corner with the smallest coordinate values relative to the rest of the points in the area; the second item is the corner with the largest coordinate values.

Inherited from IBaseGeometry.

getChildGeometry(index)

ILinearRingGeometryAccess

Creates and returns an ILinearRingGeometryAccess object for the specified contour.

Inherited from IPolygonGeometryAccess.

getClosest(anchorPosition)

Object

Searches for the point nearest to "anchorPosition" on the polygon contour.

Inherited from IPolygonGeometryAccess.

getCoordinates()

Number[][][]

Returns an array of geometry coordinates.

Inherited from IPolygonGeometryAccess.

getFillRule()

String

Returns ID of the fill rule.

Inherited from IPolygonGeometryAccess.

getLength()

Integer

Returns the number of contours in the geometry.

Inherited from IPolygonGeometryAccess.

getType()

String

Returns the "Polygon" string.

insert(index, path)

IPolygonGeometryAccess

Adds a new contour with the specified index.

Inherited from IPolygonGeometryAccess.

isFrozen()

Boolean

Returns true if the object is in "frozen" mode, otherwise false.

Inherited from IFreezable.

remove(index)

ILinearRingGeometryAccess

Removes the contour with the specified index.

Inherited from IPolygonGeometryAccess.

set(index, path)

IPolygonGeometryAccess

Sets coordinates of the contour with the specified index.

Inherited from IPolygonGeometryAccess.

setCoordinates(coordinates)

IPolygonGeometryAccess

Sets an array of geometry coordinates.

Inherited from IPolygonGeometryAccess.

setFillRule(fillRule)

IPolygonGeometryAccess

Sets the polygon's fill rule.

Inherited from IPolygonGeometryAccess.

splice(index, number)

ILinearRingGeometryAccess[]

Deletes a defined number of contours, starting from the specified index. New contours can be added in place of the deleted ones. Coordinates of the new contours can be passed as additional arguments after the "number" parameter.

Inherited from IPolygonGeometryAccess.

unfreeze()

IFreezable

Switches the object to active mode.

Inherited from IFreezable.

Methods details

getType

{String} getType()

Returns the "Polygon" string.