Documentation
Reference
2.1.53 (current version)
collection
interactivityModel
Interfaces

IPixelGeometry

Extends IBaseGeometry.

Interface of a pixel geometry.

Constructor | Fields | Methods

Constructor

IPixelGeometry()

Fields

NameTypeDescription
eventsIEventManager

Event manager.

Inherited from IEventEmitter.

Methods

NameReturnsDescription
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:

ParameterDefault valueDescription
geometry*
[no-highlight[

* Mandatory parameter/option.

]no-highlight]

Type: IPixelGeometry

The geometry to compare.

* Mandatory parameter/option.

getMetaData

{Object} getMetaData()

Returns metadata of the pixel geometry.

scale

Creates a scaled copy of the geometry.

Returns a scaled copy of the geometry.

Parameters:

ParameterDefault valueDescription
factor*
[no-highlight[

* Mandatory parameter/option.

]no-highlight]

Type: Number

Scaling factor.

* Mandatory parameter/option.

Example:

// Reducing the geometry to half its size
var smallCopy = myPixelGeometry.scale(0.5);

shift

Creates a copy of the geometry that is shifted by the specified amount.

Returns a shifted copy of the geometry.

Parameters:

ParameterDefault valueDescription
offset*
[no-highlight[

* Mandatory parameter/option.

]no-highlight]

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