IPixelGeometry

Extends IBaseGeometry.

Interface of a pixel geometry.

Constructor | Fields | Methods

Constructor

IPixelGeometry()

Fields

Name

Type

Description

events

IEventManager

Event manager.

Inherited from IEventEmitter.

Methods

Name

Returns

Description

equals(geometry)

Boolean

Returns true if the passed geometry is equivalent to the given one.

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.

getMetaData()

Object

Returns metadata of the pixel geometry.

getType()

String

Returns ID of the geometry type.

Inherited from IBaseGeometry.

scale(factor)

IPixelGeometry

Creates a scaled copy of the geometry.

shift(offset)

IPixelGeometry

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

geometry*

—

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

factor*

—

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

offset*

—

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]);