IPixelGeometry
Extends IBaseGeometry.
Interface of a pixel geometry.
Constructor | Fields | Methods
Constructor
IPixelGeometry()
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. |
|
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 |
Returns metadata of the pixel geometry. |
|
getType() |
String |
Returns ID of the geometry type. Inherited from IBaseGeometry. |
Creates a scaled copy of the geometry. |
||
Creates a copy of the geometry that is shifted by the specified amount. |
Methods details
equals
{Boolean} equals(geometry)
Returns true if the passed geometry is equivalent to the given one.
Parameters:
Parameter |
Default value |
Description |
— |
Type: IPixelGeometry The geometry to compare. |
* Mandatory parameter/option.
getMetaData
{Object} getMetaData()
Returns metadata of the pixel geometry.
scale
{IPixelGeometry} scale(factor)
Creates a scaled copy of the geometry.
Returns a scaled copy of the geometry.
Parameters:
Parameter |
Default value |
Description |
— |
Type: Number Scaling factor. |
* Mandatory parameter/option.
Example:
// Reducing the geometry to half its size
var smallCopy = myPixelGeometry.scale(0.5);
shift
{IPixelGeometry} shift(offset)
Creates a copy of the geometry that is shifted by the specified amount.
Returns a shifted copy of the geometry.
Parameters:
Parameter |
Default value |
Description |
— |
Type: Number[] Amount to shift on the axes. |
* Mandatory parameter/option.
Example:
// Shifting all the geometry's coordinates 200 pixels to the left
var shifted = myPixelGeometry.shift([-200, 0]);
Mandatory parameter/option.