Documentation
Reference
2.1.55 (current version)
collection
interactivityModel
Interfaces

IGeometry

Extends IBaseGeometry, ICustomizable.

Interface of a geometry.

Constructor | Fields | Events | Methods

Constructor

IGeometry()

Fields

NameTypeDescription
eventsIEventManager

Event manager.

Inherited from IEventEmitter.

optionsIOptionManager

Options manager.

Inherited from ICustomizable.

Events

NameDescription
mapchange

Map reference changed. Instance of the Event class. Names of fields that are available via the Event#get method:

  • oldMap - Old map.
  • newMap - New map.

optionschange

Change to the object options.

Inherited from ICustomizable.

pixelgeometrychange

The pixel geometry changed. Instance of the Event class. Names of fields that are available via the Event#get method:

Methods

NameReturnsDescription
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 southwest corner of the area; the second item is the northeast corner.

getMap()

Map|null

Returns the current map.

getPixelGeometry([options])

IPixelGeometry

Returns the pixel geometry corresponding to the given geometry, its options, and the map state.

getType()

String

Returns ID of the geometry type.

Inherited from IBaseGeometry.

setMap(map)

Sets the map.

Events details

mapchange

Map reference changed. Instance of the Event class. Names of fields that are available via the Event#get method:

  • oldMap - Old map.
  • newMap - New map.

pixelgeometrychange

The pixel geometry changed. Instance of the Event class. Names of fields that are available via the Event#get method:

Methods details

getBounds

{Number[][]|null} getBounds()

Returns coordinates of the two opposite corners of the area that surrounds the geometry. The first item in the array is the southwest corner of the area; the second item is the northeast corner.

Example:

// Setting the map center and zoom so that the geometry is displayed in its entirety inside the visible area.
map.setBounds(myGeometry.getBounds());

getMap

{Map|null} getMap()

Returns the current map.

getPixelGeometry

{IPixelGeometry} getPixelGeometry([options])

Returns the pixel geometry corresponding to the given geometry, its options, and the map state.

Parameters:

ParameterDefault valueDescription
options

Type: Object

Hash of options that allow to exclude part of the current geometry options for this calculation.

Example:

// Getting a pixel representation of the geometry with geodesics calculated, but without optimizing deletion of invisible points.
myGeometry.getPixelGeometry({
    geodesic: true,
    simplification: false
}).getCoordinates();

setMap

{} setMap(map)

Sets the map.

Parameters:

ParameterDefault valueDescription
map*
[no-highlight[

* Mandatory parameter/option.

]no-highlight]

Type: Map|null

Reference to the map.

* Mandatory parameter/option.