IPixelLineStringGeometry
Extends IPixelGeometry.
Interface for the "Polyline" pixel geometry.
Constructor | Fields | Methods
Constructor
IPixelLineStringGeometry()
Fields
Name |
Type |
Description |
Event manager. Inherited from IEventEmitter. |
Methods
Name |
Returns |
Description |
Boolean |
Returns true if the passed geometry is equivalent to the given one. Inherited from IPixelGeometry. |
|
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. |
|
Object |
Searches for a point on the polyline closest to the anchorPosition. |
|
Number[][] |
Returns coordinates of a line. |
|
Integer |
Returns the number of points in the geometry. |
|
Object |
Returns metadata of the pixel geometry. Inherited from IPixelGeometry. |
|
getType() |
String |
Returns ID of the geometry type. Inherited from IBaseGeometry. |
Creates a scaled copy of the geometry. Inherited from IPixelGeometry. |
||
Creates a copy of the geometry that is shifted by the specified amount. Inherited from IPixelGeometry. |
Methods details
getClosest
{Object} getClosest(anchorPosition)
Searches for a point on the polyline closest to the anchorPosition.
Returns an object with the following fields:
- position - Point on the polyline 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 polyline vertexes.
Parameters:
Parameter |
Default value |
Description |
— |
Type: Number[] Coordinates of a point for which the nearest polyline vertex is calculated. |
* Mandatory parameter/option.
getCoordinates
{Number[][]} getCoordinates()
Returns coordinates of a line.
getLength
{Integer} getLength()
Returns the number of points in the geometry.
Mandatory parameter/option.