geometry.base.Polygon
Extends IBasePolygonGeometry.
The "Polygon" base geometry.
Constructor | Fields | Events | Methods
Constructor
geometry.base.Polygon([coordinates[, fillRule]])
Parameters:
Parameter |
Default value |
Description |
[] |
Type: Number[][][] Geometry coordinates. |
|
"evenOdd" |
Type: String String ID that defines the polygon fill rule. Accepts one of two values:
|
Example:
var polygon = new ymaps.geometry.base.Polygon([
// Outer contour.
[
[0, 0], [0, 5], [5, 5], [5, 0], [0, 0]
],
// Inner contour.
[
[1, 1], [1, 2], [2, 2], [2, 1], [1, 1]
]
]);
Fields
Name |
Type |
Description |
Geometry event manager. |
Events
Name |
Description |
Changed coordinates. Instance of the Event class. Names of fields that are available via the Event.get method:
Inherited from IPolygonGeometryAccess. |
Methods
Name |
Returns |
Description |
Boolean |
Checks whether the passed point is located inside the polygon. Inherited from IPolygonGeometryAccess. |
|
freeze() |
Switches the object to "frozen" mode. Inherited from IFreezable. |
|
Number[][] |
Returns coordinates of the contour with the specified index. Inherited from IPolygonGeometryAccess. |
|
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. |
|
Creates and returns an ILinearRingGeometryAccess object for the specified contour. Inherited from IPolygonGeometryAccess. |
||
Object |
Searches for the point nearest to "anchorPosition" on the polygon contour. Inherited from IPolygonGeometryAccess. |
|
Number[][][] |
Returns an array of geometry coordinates. Inherited from IPolygonGeometryAccess. |
|
String |
Returns ID of the fill rule. Inherited from IPolygonGeometryAccess. |
|
Integer |
Returns the number of contours in the geometry. Inherited from IPolygonGeometryAccess. |
|
getType() |
String |
Returns the "Polygon" string. Inherited from IBasePolygonGeometry. |
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. |
Removes the contour with the specified index. Inherited from IPolygonGeometryAccess. |
||
Sets coordinates of the contour with the specified index. Inherited from IPolygonGeometryAccess. |
||
Sets an array of geometry coordinates. Inherited from IPolygonGeometryAccess. |
||
Sets the polygon's fill rule. Inherited from IPolygonGeometryAccess. |
||
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() |
Switches the object to active mode. Inherited from IFreezable. |
Fields details
events
{event.Manager} events
Geometry event manager.