IGeometry
Extends IBaseGeometry, ICustomizable.
Interface of a geometry.
Constructor | Fields | Events | Methods
Constructor
IGeometry()
Fields
Name |
Type |
Description |
Event manager. Inherited from IEventEmitter. |
||
Options manager. Inherited from ICustomizable. |
Events
Name |
Description |
Map reference changed. Instance of the Event class. Names of fields that are available via the Event.get method:
|
|
Change to the object options. Inherited from ICustomizable. |
|
The pixel geometry changed. Instance of the Event class. Names of fields that are available via the Event.get method:
|
Methods
Name |
Returns |
Description |
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. |
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. |
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:
- pixelGeometry - New IPixelGeometry pixel geometry.
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:
Parameter |
Default value |
Description |
— |
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:
Parameter |
Default value |
Description |
|
— |
Type: Map|null Reference to the map. |
* Mandatory parameter/option.
Mandatory parameter/option.