ILinearRingGeometryAccess
Extends IFreezable.
Interface for access to the "Closed contour" geometry.
Constructor | Fields | Events | Methods
Constructor
ILinearRingGeometryAccess()
Fields
Name |
Type |
Description |
Event manager for the object. Inherited from IFreezable. |
Events
Name |
Description |
Changed coordinates. Instance of the Event class. Names of fields that are available via the Event.get method:
|
Methods
Name |
Returns |
Description |
Boolean |
Checks whether the passed point is located inside the contour. |
|
freeze() |
Switches the object to "frozen" mode. Inherited from IFreezable. |
|
Number[] |
Returns coordinates of the point with the specified index. |
|
Creates and returns an IPointGeometryAccess object for the specified contour on the polyline. |
||
Object |
Searches for a point on the contour closest to the anchorPosition. |
|
Number[][] |
Returns an array of geometry coordinates. |
|
String |
Returns ID of the fill rule. |
|
Integer |
Returns the number of points in the geometry. |
|
Adds a new point with the specified index. |
||
isFrozen() |
Boolean |
Returns true if the object is in "frozen" mode, otherwise false. Inherited from IFreezable. |
Number[] |
Removes the point with the specified index. |
|
Sets coordinates of the point with the specified index. |
||
Sets an array of geometry coordinates. |
||
Sets the contour fill rule. |
||
Number[][] |
Deletes a defined number of points, starting from the specified index. New points can be added in place of the deleted ones. Coordinates of the new points can be passed as additional arguments after the "number" parameter. |
|
unfreeze() |
Switches the object to active mode. Inherited from IFreezable. |
Events details
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.
Methods details
contains
{Boolean} contains(position)
Checks whether the passed point is located inside the contour.
Returns an indicator for whether the point belongs to the contour.
Parameters:
Parameter |
Default value |
Description |
— |
Type: Number[] Coordinates of a point. |
* Mandatory parameter/option.
get
{Number[]} get(index)
Returns coordinates of the point with the specified index.
Parameters:
Parameter |
Default value |
Description |
— |
Type: Integer Index of a point. |
* Mandatory parameter/option.
getChildGeometry
{IPointGeometryAccess} getChildGeometry(index)
Creates and returns an IPointGeometryAccess object for the specified contour on the polyline.
Returns the "Point" geometry object that corresponds to the specified endpoint.
Parameters:
Parameter |
Default value |
Description |
— |
Type: Integer Index of a contour vertex. |
* Mandatory parameter/option.
getClosest
{Object} getClosest(anchorPosition)
Searches for a point on the contour closest to the anchorPosition.
Returns an object with the following fields:
- position - Point on the contour closest to "anchorPosition".
- distance - Distance from "anchorPosition" to "position".
- closestPointIndex - Index of the vertex closest to "position".
- nextPointIndex - Index of the vertex that follows "position".
- prevPointIndex - Index of the vertex that precedes "position".
The "nextPointIndex" and "prevPointIndex" fields may be omitted if "position" coincides with one of the contour vertexes.
Parameters:
Parameter |
Default value |
Description |
— |
Type: Number[] Coordinates of a point for which the nearest contour vertex is calculated. |
* Mandatory parameter/option.
getCoordinates
{Number[][]} getCoordinates()
Returns an array of geometry coordinates.
getFillRule
{String} getFillRule()
Returns ID of the fill rule.
getLength
{Integer} getLength()
Returns the number of points in the geometry.
insert
{ILinearRingGeometryAccess} insert(index, coordinates)
Adds a new point with the specified index.
Returns self-reference.
Parameters:
Parameter |
Default value |
Description |
— |
Type: Integer Index of a point. |
|
— |
Type: Number[] Coordinates of a point. |
* Mandatory parameter/option.
remove
{Number[]} remove(index)
Removes the point with the specified index.
Returns the coordinates of a deleted point.
Parameters:
Parameter |
Default value |
Description |
— |
Type: Integer Index of a point. |
* Mandatory parameter/option.
set
{ILinearRingGeometryAccess} set(index, coordinates)
Sets coordinates of the point with the specified index.
Returns self-reference.
Parameters:
Parameter |
Default value |
Description |
— |
Type: Integer Index of a point. |
|
— |
Type: Number[] Coordinates of a point. |
* Mandatory parameter/option.
setCoordinates
{ILinearRingGeometryAccess} setCoordinates(coordinates)
Sets an array of geometry coordinates.
Returns self-reference.
Parameters:
Parameter |
Default value |
Description |
— |
Type: Number[][] Geometry coordinates. |
* Mandatory parameter/option.
setFillRule
{ILinearRingGeometryAccess} setFillRule(fillRule)
Sets the contour fill rule.
Returns self-reference.
Parameters:
Parameter |
Default value |
Description |
— |
Type: String ID of the fill rule. |
* Mandatory parameter/option.
splice
{Number[][]} splice(index, number)
Deletes a defined number of points, starting from the specified index. New points can be added in place of the deleted ones. Coordinates of the new points can be passed as additional arguments after the "number" parameter.
Returns an array of coordinates of deleted points.
Parameters:
Parameter |
Default value |
Description |
— |
Type: Integer The index to start from for removing and adding points. |
|
— |
Type: Integer The number of deleted points. |
* Mandatory parameter/option.
Mandatory parameter/option.