# Vexcel Map Control API - Complete Documentation (Version 2.0.2)
This file contains the complete Vexcel Map Control API documentation, including all tutorials, class references, and examples.
## Table of Contents
1. [ArcGISLayer](#section-1)
2. [Bar](#section-2)
3. [BaseGroupLayer](#section-3)
4. [BaseLayer](#section-4)
5. [BaseVectorLayer](#section-5)
6. [BingLayer](#section-6)
7. [Button](#section-7)
8. [Circle](#section-8)
9. [CircleTool](#section-9)
10. [Collection](#section-10)
11. [CollectionManager](#section-11)
12. [CollectionStatus](#section-12)
13. [Extent](#section-13)
14. [Feature](#section-14)
15. [Fill](#section-15)
16. [GeoJSON](#section-16)
17. [GroupLayer](#section-17)
18. [HeightTool](#section-18)
19. [Icon](#section-19)
20. [Image](#section-20)
21. [ImageryLayer](#section-21)
22. [InfoBox](#section-22)
23. [LayerCollections](#section-23)
24. [LayerCollectionsStatus](#section-24)
25. [LayerEvents](#section-25)
26. [Line](#section-26)
27. [LineTool](#section-27)
28. [Location](#section-28)
29. [Login](#section-29)
30. [Map](#section-30)
31. [MapStatus](#section-31)
32. [MapStatusView](#section-32)
33. [Measure](#section-33)
34. [MeasurementManager](#section-34)
36. [MultiPolygon](#section-36)
37. [OSMLayer](#section-37)
38. [OverlayManager](#section-38)
39. [Point](#section-39)
40. [PointTool](#section-40)
41. [Polygon](#section-41)
42. [PolygonTool](#section-42)
43. [RectangleTool](#section-43)
44. [RegularShape](#section-44)
45. [RelativeHeightTool](#section-45)
47. [Stroke](#section-47)
48. [Style](#section-48)
49. [Swipe](#section-49)
50. [Text](#section-50)
51. [Toggle](#section-51)
52. [Transform](#section-52)
53. [UserService](#section-53)
54. [VectorLayer](#section-54)
55. [VectorTileLayer](#section-55)
56. [WFSLayer](#section-56)
57. [WKT](#section-57)
58. [WMSLayer](#section-58)
59. [WMTSLayer](#section-59)
60. [XYZLayer](#section-60)
61. [Index](#section-61)
62. [Module Constants](#section-62)
63. [Tutorial control bar](#section-63)
64. [Tutorial control basics](#section-64)
65. [Tutorial control brightness contrast](#section-65)
66. [Tutorial control button](#section-66)
67. [Tutorial control layers](#section-67)
68. [Tutorial control modes](#section-68)
69. [Tutorial control orientation](#section-69)
70. [Tutorial control swipe](#section-70)
71. [Tutorial control toggle](#section-71)
72. [Tutorial control vexcel collections find](#section-72)
73. [Tutorial control vexcel image metadata](#section-73)
74. [Tutorial control vexcel infrared](#section-74)
75. [Tutorial control vexcel integration](#section-75)
76. [Tutorial control vexcel layer](#section-76)
77. [Tutorial control vexcel show collection](#section-77)
78. [Tutorial control zoom](#section-78)
79. [Tutorial control](#section-79)
80. [Tutorial geometries features click](#section-80)
81. [Tutorial geometries features hover](#section-81)
82. [Tutorial geometries features styles](#section-82)
83. [Tutorial geometries geojson reader](#section-83)
84. [Tutorial geometries line](#section-84)
85. [Tutorial geometries multipolygon](#section-85)
86. [Tutorial geometries point shapes styles](#section-86)
87. [Tutorial geometries point styles](#section-87)
88. [Tutorial geometries point](#section-88)
89. [Tutorial geometries polygon styles](#section-89)
90. [Tutorial geometries polygon](#section-90)
91. [Tutorial geometries text styles](#section-91)
92. [Tutorial geometries wkt reader](#section-92)
93. [Tutorial geometries](#section-93)
94. [Tutorial infobox click](#section-94)
95. [Tutorial infobox feature](#section-95)
96. [Tutorial infobox fixed](#section-96)
97. [Tutorial infobox ](#section-97)
98. [Tutorial layers arcgis](#section-98)
99. [Tutorial layers bing](#section-99)
100. [Tutorial layers group](#section-100)
101. [Tutorial layers vector tiles](#section-101)
102. [Tutorial layers vector](#section-102)
103. [Tutorial layers wfs](#section-103)
104. [Tutorial layers wms](#section-104)
105. [Tutorial layers wmts](#section-105)
106. [Tutorial layers xyz](#section-106)
107. [Tutorial layers](#section-107)
108. [Tutorial measures 3d geometries](#section-108)
109. [Tutorial measures change units](#section-109)
110. [Tutorial measures edit geometries](#section-110)
111. [Tutorial measures geometries](#section-111)
112. [Tutorial measures simple tooltip](#section-112)
113. [Tutorial measures tooltips](#section-113)
114. [Tutorial measures](#section-114)
115. [Tutorial start 3d mode](#section-115)
116. [Tutorial start basic](#section-116)
117. [Tutorial start constrained zoom](#section-117)
118. [Tutorial start image 3d mode](#section-118)
119. [Tutorial start multiple maps](#section-119)
120. [Tutorial start no layers](#section-120)
121. [Tutorial start restricted extent](#section-121)
122. [Tutorial start token](#section-122)
123. [Tutorial start](#section-123)
124. [Tutorial styles](#section-124)
125. [Tutorial third party bing](#section-125)
126. [Tutorial third party cesium](#section-126)
127. [Tutorial third party google sbs](#section-127)
128. [Tutorial third party google](#section-128)
129. [Tutorial third party leaflet](#section-129)
130. [Tutorial third party](#section-130)
131. [Tutorial utils transform](#section-131)
132. [Tutorial utils](#section-132)
133. [Tutorial vector](#section-133)
134. [Tutorial walk basic map](#section-134)
135. [Tutorial walk](#section-135)
================================================================================
## 1. ArcGISLayer
Class
# ArcGISLayer
## ArcGISLayer(url, opts)
Layer definition for ARCGIS feature service.
See more in our ArcGIS Feature tutorial.
#### #
new ArcGISLayer(url, opts)
Initialization object
| Name | Type | Attributes | Default | Description |
| --- | --- | --- | --- | --- |
| url | string | | | ARCGIS service URL. |
| opts | object | | | ArcGIS Rest feature layer options. |
| name | string | | | Layer name |
| order | number | | | The order for layer rendering. At rendering time, the layers will be ordered, first by order and then by position. When undefined, a order of 0 is assumed for layers that are added to the map's layers collection. |
| visible | boolean | | true | Visibility |
| opacity | number | | 1 | Opacity (0, 1). |
| attributions | string | | | Attributions. |
| obliqueProjection | ObliqueProjections | | none | Set how the vector layer will reproject in oblique mode. If none it´s set, the vector layer will not reproject in oblique mode.'dtm' the layer will reproject the points on the dtm surface.'dsm' the layer will reprojects the points on the dsm surface, if there´s no DSM available DTM will be used instead. |
url
ARCGIS service URL.
opts
ArcGIS Rest feature layer options.
name
Layer name
order
The order for layer rendering. At rendering time, the layers will be ordered, first by order and then by position. When undefined, a order of 0 is assumed for layers that are added to the map's layers collection.
visible
Visibility
opacity
Opacity (0, 1).
attributions
Attributions.
obliqueProjection
Set how the vector layer will reproject in oblique mode. If none it´s set, the vector layer will not reproject in oblique mode.'dtm' the layer will reproject the points on the dtm surface.'dsm' the layer will reprojects the points on the dsm surface, if there´s no DSM available DTM will be used instead.
**Tutorials:**
: ArcGIS Feature
- ArcGIS Feature
- LayerEvents#event:VISIBILITY_CHANGE
Create empty layer
const options = { url :"https://www.sample-url.com/tiles/{x}/{y}/{z}" };
const layer = new Vexcel.Layers.ARCGISLayer(options);
const options = { url :"https://www.sample-url.com/tiles/{x}/{y}/{z}" };
const layer = new Vexcel.Layers.ARCGISLayer(options);
### Extends
- BaseVectorLayer
### Classes
**ArcGISLayer**
# Methods
#### #
getAttributions() -> {string}
Gets the attributions of the layer.
Attributions of the layer.
#### #
getBoundingBox() -> {Extent}
Gets the bounding box of features in the layer
**Overrides:**
: BaseVectorLayer#getBoundingBox
- BaseVectorLayer#getBoundingBox
bounding box
#### #
getMaxZoom() -> {number}
Gets the maximum zoom level of the layer.
**Overrides:**
: BaseVectorLayer#getMaxZoom
- BaseVectorLayer#getMaxZoom
The maximum zoom level of the layer.
#### #
getMinZoom() -> {number}
Gets the minimum zoom level of the layer.
**Overrides:**
: BaseVectorLayer#getMinZoom
- BaseVectorLayer#getMinZoom
The minimum zoom level of the layer.
#### #
getObliqueProjection() -> {string}
Gets the oblique projection of the layer.
**Overrides:**
: BaseVectorLayer#getObliqueProjection
- BaseVectorLayer#getObliqueProjection
The oblique projection of the layer.
#### #
getOpacity() -> {number}
Gets the opacity of the layer (between 0 and 1).
**Overrides:**
: BaseVectorLayer#getOpacity
- BaseVectorLayer#getOpacity
The opacity of the layer.
#### #
getVisible() -> {boolean}
Gets the visibility of the layer (true or false).
true
false
**Overrides:**
: BaseVectorLayer#getVisible
- BaseVectorLayer#getVisible
The visibility of the layer.
#### #
setAttributions(attributions)
Sets the attributions of the layer.
| Name | Type | Description |
| --- | --- | --- |
| attributions | string | Attributions. Can be passed as string. |
attributions
Attributions. Can be passed as string.
#### #
setMaxZoom(maxZoom)
Sets the maximum zoom (exclusive) at which the layer is visible.
Note that the zoom levels for layer visibility are based on the
view zoom level, which may be different from a tile source zoom level.
| Name | Type | Description |
| --- | --- | --- |
| maxZoom | number | The maximum zoom of the layer. |
maxZoom
The maximum zoom of the layer.
**Overrides:**
: BaseVectorLayer#setMaxZoom
- BaseVectorLayer#setMaxZoom
#### #
setMinZoom(minZoom)
Sets the minimum zoom (inclusive) at which the layer is visible.
Note that the zoom levels for layer visibility are based on the
view zoom level, which may be different from a tile source zoom level.
| Name | Type | Description |
| --- | --- | --- |
| minZoom | number | The minimum zoom of the layer. |
minZoom
The minimum zoom of the layer.
**Overrides:**
: BaseVectorLayer#setMinZoom
- BaseVectorLayer#setMinZoom
#### #
setObliqueProjection(obliqueProjection)
Sets the oblique projection of the layer.
Note:
- 'none' it´s set, the vector layer will not reprojects on oblique mode.
- 'dtm' the layer will reprojects the points on the dtm surface
- 'dsm' the layer will reprojects the points on the dsm surface, if there´s no DSM available DTM will be used instead.
| Name | Type | Description |
| --- | --- | --- |
| obliqueProjection | ObliqueProjections | The oblique projection of the layer. |
obliqueProjection
The oblique projection of the layer.
**Overrides:**
: BaseVectorLayer#setObliqueProjection
- BaseVectorLayer#setObliqueProjection
**See:**
: ObliqueProjections
- ObliqueProjections
#### #
setOpacity(opacity)
Sets the opacity of the layer, allowed values range from 0 to 1.
| Name | Type | Description |
| --- | --- | --- |
| opacity | number | The opacity of the layer. |
opacity
The opacity of the layer.
**Overrides:**
: BaseVectorLayer#setOpacity
- BaseVectorLayer#setOpacity
#### #
setVisible(visible)
Sets the visibility of the layer (true or false).
true
false
| Name | Type | Description |
| --- | --- | --- |
| visible | boolean | The visibility of the layer. |
visible
The visibility of the layer.
**Overrides:**
: BaseVectorLayer#setVisible
- BaseVectorLayer#setVisible
================================================================================
## 2. Bar
Class
# Bar
## Bar(opts)
The control bar is a container for other controls. It can be used to create custom toolbars. Control bars can be nested and combined with other controls to handle activate/deactivate.
#### #
new Bar(opts)
Initialization object
| Name | Type | Attributes | Default | Description |
| --- | --- | --- | --- | --- |
| opts | object | | | Button options. |
| className | string | | | class of the control |
| group | boolean | | false | is a part of a group, default false |
| toggleOne | boolean | | | only one toggle control is active at a time, default false |
| autoDeactivate | boolean | | | used with subbar to deactivate all control when top level control deactivate, default false |
| position | string | | | a combination of top|left|bottom|right |
| controls | Array. | | | a list of control to add to the bar |
opts
Button options.
className
class of the control
group
is a part of a group, default false
toggleOne
only one toggle control is active at a time, default false
autoDeactivate
used with subbar to deactivate all control when top level control deactivate, default false
position
a combination of top|left|bottom|right
controls
a list of control to add to the bar
**Tutorials:**
: Map Bar Control
- Map Bar Control
### Classes
**Bar**
# Methods
#### #
addControl(control)
Add a control to the bar
| Name | Type | Description |
| --- | --- | --- |
| control | object | control to add |
control
control to add
#### #
setPosition(position)
Set position for the bar.
| Name | Type | Description |
| --- | --- | --- |
| position | string | a combination of top | left | bottom | right, e.g. "top", "bottom-right" or "top-left" |
position
a combination of top | left | bottom | right, e.g. "top", "bottom-right" or "top-left"
================================================================================
## 3. BaseGroupLayer
Class
# BaseGroupLayer
## BaseGroupLayer
Abstract base group layer
- LayerEvents#event:VISIBILITY_CHANGE
### Extends
- BaseLayer
### Classes
**BaseGroupLayer**
# Methods
#### #
getMaxZoom() -> {number}
Gets the maximum zoom level of the layer.
**Overrides:**
: BaseLayer#getMaxZoom
- BaseLayer#getMaxZoom
The maximum zoom level of the layer.
#### #
getMinZoom() -> {number}
Gets the minimum zoom level of the layer.
**Overrides:**
: BaseLayer#getMinZoom
- BaseLayer#getMinZoom
The minimum zoom level of the layer.
#### #
getOpacity() -> {number}
Gets the opacity of the layer (between 0 and 1).
**Overrides:**
: BaseLayer#getOpacity
- BaseLayer#getOpacity
The opacity of the layer.
#### #
getVisible() -> {boolean}
Gets the visibility of the layer (true or false).
true
false
**Overrides:**
: BaseLayer#getVisible
- BaseLayer#getVisible
The visibility of the layer.
#### #
setMaxZoom(maxZoom)
Sets the maximum zoom (exclusive) at which the layer is visible.
Note that the zoom levels for layer visibility are based on the
view zoom level, which may be different from a tile source zoom level.
| Name | Type | Description |
| --- | --- | --- |
| maxZoom | number | The maximum zoom of the layer. |
maxZoom
The maximum zoom of the layer.
**Overrides:**
: BaseLayer#setMaxZoom
- BaseLayer#setMaxZoom
#### #
setMinZoom(minZoom)
Sets the minimum zoom (inclusive) at which the layer is visible.
Note that the zoom levels for layer visibility are based on the
view zoom level, which may be different from a tile source zoom level.
| Name | Type | Description |
| --- | --- | --- |
| minZoom | number | The minimum zoom of the layer. |
minZoom
The minimum zoom of the layer.
**Overrides:**
: BaseLayer#setMinZoom
- BaseLayer#setMinZoom
#### #
setOpacity(opacity)
Sets the opacity of the layer, allowed values range from 0 to 1.
| Name | Type | Description |
| --- | --- | --- |
| opacity | number | The opacity of the layer. |
opacity
The opacity of the layer.
**Overrides:**
: BaseLayer#setOpacity
- BaseLayer#setOpacity
#### #
setVisible(visible)
Sets the visibility of the layer (true or false).
true
false
| Name | Type | Description |
| --- | --- | --- |
| visible | boolean | The visibility of the layer. |
visible
The visibility of the layer.
**Overrides:**
: BaseLayer#setVisible
- BaseLayer#setVisible
================================================================================
## 4. BaseLayer
Class
# BaseLayer
## BaseLayer
Abstract base layer
- LayerEvents#event:VISIBILITY_CHANGE
### Classes
**BaseLayer**
# Methods
#### #
getMaxZoom() -> {number}
Gets the maximum zoom level of the layer.
The maximum zoom level of the layer.
#### #
getMinZoom() -> {number}
Gets the minimum zoom level of the layer.
The minimum zoom level of the layer.
#### #
getOpacity() -> {number}
Gets the opacity of the layer (between 0 and 1).
The opacity of the layer.
#### #
getVisible() -> {boolean}
Gets the visibility of the layer (true or false).
true
false
The visibility of the layer.
#### #
setMaxZoom(maxZoom)
Sets the maximum zoom (exclusive) at which the layer is visible.
Note that the zoom levels for layer visibility are based on the
view zoom level, which may be different from a tile source zoom level.
| Name | Type | Description |
| --- | --- | --- |
| maxZoom | number | The maximum zoom of the layer. |
maxZoom
The maximum zoom of the layer.
#### #
setMinZoom(minZoom)
Sets the minimum zoom (inclusive) at which the layer is visible.
Note that the zoom levels for layer visibility are based on the
view zoom level, which may be different from a tile source zoom level.
| Name | Type | Description |
| --- | --- | --- |
| minZoom | number | The minimum zoom of the layer. |
minZoom
The minimum zoom of the layer.
#### #
setOpacity(opacity)
Sets the opacity of the layer, allowed values range from 0 to 1.
| Name | Type | Description |
| --- | --- | --- |
| opacity | number | The opacity of the layer. |
opacity
The opacity of the layer.
#### #
setVisible(visible)
Sets the visibility of the layer (true or false).
true
false
| Name | Type | Description |
| --- | --- | --- |
| visible | boolean | The visibility of the layer. |
visible
The visibility of the layer.
================================================================================
## 5. BaseVectorLayer
Class
# BaseVectorLayer
## BaseVectorLayer
Abstract base vector layer
- LayerEvents#event:VISIBILITY_CHANGE
### Extends
- BaseLayer
### Classes
**BaseVectorLayer**
# Methods
#### #
getBoundingBox() -> {Extent}
Gets the bounding box of features in the layer
bounding box
#### #
getMaxZoom() -> {number}
Gets the maximum zoom level of the layer.
**Overrides:**
: BaseLayer#getMaxZoom
- BaseLayer#getMaxZoom
The maximum zoom level of the layer.
#### #
getMinZoom() -> {number}
Gets the minimum zoom level of the layer.
**Overrides:**
: BaseLayer#getMinZoom
- BaseLayer#getMinZoom
The minimum zoom level of the layer.
#### #
getObliqueProjection() -> {string}
Gets the oblique projection of the layer.
The oblique projection of the layer.
#### #
getOpacity() -> {number}
Gets the opacity of the layer (between 0 and 1).
**Overrides:**
: BaseLayer#getOpacity
- BaseLayer#getOpacity
The opacity of the layer.
#### #
getVisible() -> {boolean}
Gets the visibility of the layer (true or false).
true
false
**Overrides:**
: BaseLayer#getVisible
- BaseLayer#getVisible
The visibility of the layer.
#### #
setMaxZoom(maxZoom)
Sets the maximum zoom (exclusive) at which the layer is visible.
Note that the zoom levels for layer visibility are based on the
view zoom level, which may be different from a tile source zoom level.
| Name | Type | Description |
| --- | --- | --- |
| maxZoom | number | The maximum zoom of the layer. |
maxZoom
The maximum zoom of the layer.
**Overrides:**
: BaseLayer#setMaxZoom
- BaseLayer#setMaxZoom
#### #
setMinZoom(minZoom)
Sets the minimum zoom (inclusive) at which the layer is visible.
Note that the zoom levels for layer visibility are based on the
view zoom level, which may be different from a tile source zoom level.
| Name | Type | Description |
| --- | --- | --- |
| minZoom | number | The minimum zoom of the layer. |
minZoom
The minimum zoom of the layer.
**Overrides:**
: BaseLayer#setMinZoom
- BaseLayer#setMinZoom
#### #
setObliqueProjection(obliqueProjection)
Sets the oblique projection of the layer.
Note:
- 'none' it´s set, the vector layer will not reprojects on oblique mode.
- 'dtm' the layer will reprojects the points on the dtm surface
- 'dsm' the layer will reprojects the points on the dsm surface, if there´s no DSM available DTM will be used instead.
| Name | Type | Description |
| --- | --- | --- |
| obliqueProjection | ObliqueProjections | The oblique projection of the layer. |
obliqueProjection
The oblique projection of the layer.
**See:**
: ObliqueProjections
- ObliqueProjections
#### #
setOpacity(opacity)
Sets the opacity of the layer, allowed values range from 0 to 1.
| Name | Type | Description |
| --- | --- | --- |
| opacity | number | The opacity of the layer. |
opacity
The opacity of the layer.
**Overrides:**
: BaseLayer#setOpacity
- BaseLayer#setOpacity
#### #
setVisible(visible)
Sets the visibility of the layer (true or false).
true
false
| Name | Type | Description |
| --- | --- | --- |
| visible | boolean | The visibility of the layer. |
visible
The visibility of the layer.
**Overrides:**
: BaseLayer#setVisible
- BaseLayer#setVisible
================================================================================
## 6. BingLayer
Class
# BingLayer
## BingLayer(opts)
Layer for the Bing Maps tile server.
Learn more in our layers-bing tutorial.
#### #
new BingLayer(opts)
Initialization object
| Name | Type | Attributes | Default | Description |
| --- | --- | --- | --- | --- |
| opts | object | | | OSM layer options. |
| key | string | | | Bing Maps API key. Get yours at https://www.bingmapsportal.com/. |
| imagerySet | string | | | Type of imagery. |
| name | string | | | Layer name |
| order | number | | | The order for layer rendering. At rendering time, the layers will be ordered, first by order and then by position. When undefined, a order of 0 is assumed for layers that are added to the map's layers collection. |
| visible | boolean | | false | Visibility |
| opacity | number | | 1 | Opacity (0, 1). |
opts
OSM layer options.
key
Bing Maps API key. Get yours at https://www.bingmapsportal.com/.
imagerySet
Type of imagery.
name
Layer name
order
The order for layer rendering. At rendering time, the layers will be ordered, first by order and then by position. When undefined, a order of 0 is assumed for layers that are added to the map's layers collection.
visible
Visibility
opacity
Opacity (0, 1).
**Tutorials:**
: layers-bing
- layers-bing
- LayerEvents#event:VISIBILITY_CHANGE
Create empty layer
const options = { key :"test_key" };
const layer = new Vexcel.Layers.BingLayer(options);
const options = { key :"test_key" };
const layer = new Vexcel.Layers.BingLayer(options);
### Extends
- BaseLayer
### Classes
**BingLayer**
# Methods
#### #
getMaxZoom() -> {number}
Gets the maximum zoom level of the layer.
**Overrides:**
: BaseLayer#getMaxZoom
- BaseLayer#getMaxZoom
The maximum zoom level of the layer.
#### #
getMinZoom() -> {number}
Gets the minimum zoom level of the layer.
**Overrides:**
: BaseLayer#getMinZoom
- BaseLayer#getMinZoom
The minimum zoom level of the layer.
#### #
getOpacity() -> {number}
Gets the opacity of the layer (between 0 and 1).
**Overrides:**
: BaseLayer#getOpacity
- BaseLayer#getOpacity
The opacity of the layer.
#### #
getVisible() -> {boolean}
Gets the visibility of the layer (true or false).
true
false
**Overrides:**
: BaseLayer#getVisible
- BaseLayer#getVisible
The visibility of the layer.
#### #
setMaxZoom(maxZoom)
Sets the maximum zoom (exclusive) at which the layer is visible.
Note that the zoom levels for layer visibility are based on the
view zoom level, which may be different from a tile source zoom level.
| Name | Type | Description |
| --- | --- | --- |
| maxZoom | number | The maximum zoom of the layer. |
maxZoom
The maximum zoom of the layer.
**Overrides:**
: BaseLayer#setMaxZoom
- BaseLayer#setMaxZoom
#### #
setMinZoom(minZoom)
Sets the minimum zoom (inclusive) at which the layer is visible.
Note that the zoom levels for layer visibility are based on the
view zoom level, which may be different from a tile source zoom level.
| Name | Type | Description |
| --- | --- | --- |
| minZoom | number | The minimum zoom of the layer. |
minZoom
The minimum zoom of the layer.
**Overrides:**
: BaseLayer#setMinZoom
- BaseLayer#setMinZoom
#### #
setOpacity(opacity)
Sets the opacity of the layer, allowed values range from 0 to 1.
| Name | Type | Description |
| --- | --- | --- |
| opacity | number | The opacity of the layer. |
opacity
The opacity of the layer.
**Overrides:**
: BaseLayer#setOpacity
- BaseLayer#setOpacity
#### #
setVisible(visible)
Sets the visibility of the layer (true or false).
true
false
| Name | Type | Description |
| --- | --- | --- |
| visible | boolean | The visibility of the layer. |
visible
The visibility of the layer.
**Overrides:**
: BaseLayer#setVisible
- BaseLayer#setVisible
================================================================================
## 7. Button
Class
# Button
## Button(opts)
A simple push button control. This control can be used in countless ways, including running custom logic with the click of a button.
#### #
new Button(opts)
Initialization object
| Name | Type | Attributes | Description |
| --- | --- | --- | --- |
| opts | object | | Button options. |
| className | string | | class of the control |
| title | number | | title of the control |
| name | boolean | | name of the control (optional), default none |
| html | number | | html to insert in the control |
| handleClick | function | | callback when control is clicked |
opts
Button options.
className
class of the control
title
title of the control
name
name of the control (optional), default none
html
html to insert in the control
handleClick
callback when control is clicked
**Tutorials:**
: Map Button
- Map Button
### Classes
**Button**
================================================================================
## 8. Circle
Class
# Circle
## Circle(opts)
Set circle style for vector features.
Learn how to implement a Circle in our Point styles tutorial.
#### #
new Circle(opts)
Initialization object
| Name | Type | Attributes | Description |
| --- | --- | --- | --- |
| opts | object | | Options |
| fill | Fill | | Fill style. |
| stroke | Stroke | | Stroke style |
| radius | number | | Circle radius. |
| opacity | number | | Opacity. |
| rotateWithView | boolean | | Whether to rotate the shape with the view (meaningful only when used in conjunction with a two dimensional scale). |
| rotation | number | | Rotation in radians (positive rotation clockwise, meaningful only when used in conjunction with a two dimensional scale). |
| scale | number | | Scale. A two dimensional scale will produce an ellipse. Unless two dimensional scaling is required a better result may be obtained with an appropriate setting for radius |
| displacement | number | | Displacement. |
opts
Options
fill
Fill style.
stroke
Stroke style
radius
Circle radius.
opacity
Opacity.
rotateWithView
Whether to rotate the shape with the view (meaningful only when used in conjunction with a two dimensional scale).
rotation
Rotation in radians (positive rotation clockwise, meaningful only when used in conjunction with a two dimensional scale).
scale
Scale. A two dimensional scale will produce an ellipse. Unless two dimensional scaling is required a better result may be obtained with an appropriate setting for radius
displacement
Displacement.
**Tutorials:**
: Point styles
- Point styles
### Classes
**Circle**
# Methods
#### #
getAnchor() -> {Array.}
Get the anchor point in pixels. The anchor determines the center point for the
symbolizer.
Anchor.
#### #
getDisplacement() -> {Array.}
Get the displacement of the shape
Shape's center displacement
#### #
getFill() -> {Fill}
Get the fill style.
#### #
getOpacity() -> {number}
Get the symbolizer opacity.
Opacity.
#### #
getRadius() -> {number}
Get the (primary) radius for the shape.
Radius.
#### #
getRotateWithView() -> {boolean}
Determine whether the symbolizer rotates with the map.
Rotate with map.
#### #
getRotation() -> {number}
Get the symoblizer rotation.
Rotation.
#### #
getScale() -> {number}
Get the symbolizer scale.
Scale.
#### #
getStroke() -> {Stroke}
Get the stroke style
#### #
setFill(fill)
Set the fill style.
| Name | Type | Description |
| --- | --- | --- |
| fill | Fill | |
fill
#### #
setOpacity(opacity)
Set the opacity.
| Name | Type | Description |
| --- | --- | --- |
| opacity | number | Opacity. |
opacity
Opacity.
#### #
setRotateWithView(rotateWithView)
Set whether to rotate the style with the view.
| Name | Type | Description |
| --- | --- | --- |
| rotateWithView | boolean | Rotate with map. |
rotateWithView
Rotate with map.
#### #
setRotation(rotation)
Set the rotation.
| Name | Type | Description |
| --- | --- | --- |
| rotation | number | Rotation. |
rotation
Rotation.
#### #
setScale(scale)
Set the scale.
| Name | Type | Description |
| --- | --- | --- |
| scale | number | Scale. |
scale
Scale.
#### #
setStroke(stroke)
Set the stroke style
| Name | Type | Description |
| --- | --- | --- |
| stroke | Stroke | |
stroke
================================================================================
## 9. CircleTool
Class
# CircleTool
## CircleTool
Measurement tool to draw Circles.
- Learn more about our Circle Tool in our 2D mode and 3D mode tutorials.
### Classes
**CircleTool**
# Methods
#### #
activate()
This method activate the tool and you can start to draw a circle
#### #
cancel()
This method cancel the current measure
#### #
changeAreaUnits(unit)
Sets the area units to be shown by the tool.
| Name | Type | Description |
| --- | --- | --- |
| unit | AreaUnits | Imperial or metric value from AreaUnits |
unit
Imperial or metric value from AreaUnits
**See:**
: AreaUnits
- AreaUnits
#### #
changeLengthUnits(unit)
Sets the length units to be shown by the tool.
| Name | Type | Description |
| --- | --- | --- |
| unit | LengthUnits | Imperial or metric value from LengthUnits |
unit
Imperial or metric value from LengthUnits
**See:**
: LengthUnits
- LengthUnits
#### #
changeSlopeUnits(unit)
Sets the slope units to be shown by the tool.
| Name | Type | Description |
| --- | --- | --- |
| unit | SlopeUnits | Imperial or metric value from SlopeUnits |
unit
Imperial or metric value from SlopeUnits
**See:**
: SlopeUnits
- SlopeUnits
#### #
changeTooltipsVisibility(visible)
Change visibility for measurement tooltips
| Name | Type | Description |
| --- | --- | --- |
| visible | boolean | boolean |
visible
boolean
#### #
clear()
This method clears all measurements of this tool.
#### #
deactivate()
This method deactivate the tool
#### #
disableEdit()
This method disable de edit mode for this tool
#### #
enableEdit()
This method enable de edit mode for this tool
================================================================================
## 10. Collection
Class
# Collection
## Collection
Represents a collection of geospatial imagery metadata.
This class provides structured access to information about an image collection,
including capture details, resolution, product type, and geometry.
It supports both standard and GraySky collections.
### Classes
**Collection**
# Members
#### #
firstCaptureDate
First capture date.
#### #
geometry
Geometry.
#### #
graySkyEvent
Graysky event. Only if layer collections is graysky
#### #
graySkyEventPrettyName
Graysky event pretty name. Only if layer collections is graysky
#### #
imageryLayer
Imagery layer name. Should be a value from VexcelLayers
#### #
lastCaptureDate
Last capture date.
#### #
maxGsd
Max gsd.
#### #
minGsd
Min gsd.
#### #
name
name.
#### #
oblique
Indicates if 3D oblique imagery is available.
#### #
prettyName
Pretty name.
#### #
productType
Product type.
================================================================================
## 11. CollectionManager
Class
# CollectionManager
## CollectionManager
The Collection Manager class provides interaction with the collections loaded by the map depending on your privileges.
### Classes
**CollectionManager**
# Methods
#### #
findCollectionsByExtent(extent, epsg) -> {Array.}
Filters collections based on an extent.
| Name | Type | Description |
| --- | --- | --- |
| extent | Extent | array with 4 coordinates[] |
| epsg | string | Optional parameter to specify the coordinates system of extent (ie. 'EPSG:4326'). |
extent
array with 4 coordinates[]
epsg
Optional parameter to specify the coordinates system of extent (ie. 'EPSG:4326').
- Filtered collections.
#### #
findCollectionsByImageryLayers(imageryLayers) -> {Array.}
Filters collections based on the specified layers.
| Name | Type | Description |
| --- | --- | --- |
| imageryLayers | Array. | Imagery layers to filter collections. Only collections matching these programs will be included. |
imageryLayers
Imagery layers to filter collections. Only collections matching these programs will be included.
- Filtered collections.
#### #
findCollectionsByLocation(location, epsg) -> {Array.}
Filters collections based on a location.
| Name | Type | Description |
| --- | --- | --- |
| location | Location | object with geographic coordinates [Lat,Lng] |
| epsg | string | Optional parameter to specify the coordinates system of extent (ie. 'EPSG:4326'). |
location
object with geographic coordinates [Lat,Lng]
epsg
Optional parameter to specify the coordinates system of extent (ie. 'EPSG:4326').
- Filtered collections.
================================================================================
## 12. CollectionStatus
Class
# CollectionStatus
## CollectionStatus
Represents the status of a geospatial imagery collection,
extending the base Collection class with additional metadata related
to image orientations and relevant view information (such as center, zoom, and extent). This class provides structured access to
collection information, including resolution, capture details,
and orientation options. It supports both standard and GraySky collections.
Collection
### Extends
- Collection
### Classes
**CollectionStatus**
# Members
#### #
firstCaptureDate
First capture date.
**Overrides:**
: Collection#firstCaptureDate
- Collection#firstCaptureDate
#### #
geometry
Geometry.
**Overrides:**
: Collection#geometry
- Collection#geometry
#### #
graySkyEvent
Graysky event. Only if layer collections is graysky
**Overrides:**
: Collection#graySkyEvent
- Collection#graySkyEvent
#### #
graySkyEventPrettyName
Graysky event pretty name. Only if layer collections is graysky
**Overrides:**
: Collection#graySkyEventPrettyName
- Collection#graySkyEventPrettyName
#### #
imageryLayer
Imagery layer name. Should be a value from VexcelLayers
**Overrides:**
: Collection#imageryLayer
- Collection#imageryLayer
#### #
lastCaptureDate
Last capture date.
**Overrides:**
: Collection#lastCaptureDate
- Collection#lastCaptureDate
#### #
maxGsd
Max gsd.
**Overrides:**
: Collection#maxGsd
- Collection#maxGsd
#### #
minGsd
Min gsd.
**Overrides:**
: Collection#minGsd
- Collection#minGsd
#### #
name
name.
**Overrides:**
: Collection#name
- Collection#name
#### #
oblique
Indicates if 3D oblique imagery is available.
**Overrides:**
: Collection#oblique
- Collection#oblique
#### #
orientations
Available orientations.
#### #
prettyName
Pretty name.
**Overrides:**
: Collection#prettyName
- Collection#prettyName
#### #
productType
Product type.
**Overrides:**
: Collection#productType
- Collection#productType
#### #
viewInfo
Relevant info for center, zoom and extent
================================================================================
## 13. Extent
Class
# Extent
## Extent(coords)
This class involves a set of coordinates that are used to represent a rectangular area on the map. These coordinates create an extent, or a bounding box, which are often used for setting the map view. They are also very useful for doing calculations.
#### #
new Extent(coords)
| Name | Type | Description |
| --- | --- | --- |
| coords | Array. | The latitude of the location. |
coords
The latitude of the location.
Create simple extent object
const extent = new Vexcel.Geometry.Extent([20,10,-20,-10]);
const extent = new Vexcel.Geometry.Extent([20,10,-20,-10]);
### Classes
**Extent**
# Methods
#### #
buffer(value) -> {Extent}
Return extent buffered by the provided value.
| Name | Type | Description |
| --- | --- | --- |
| value | number | The amount by which the extent should be buffered. |
value
The amount by which the extent should be buffered.
#### #
clone() -> {Extent}
Make a complete copy of the Extent.
Clone
#### #
containsExtent(extent) -> {boolean}
Check if one extent contains another.
An extent is deemed contained if it lies completely within the other extent, including if they share one or more edges.
| Name | Type | Description |
| --- | --- | --- |
| extent | Extent | |
extent
#### #
containsLocation(location) -> {boolean}
Check if the passed location is contained or on the edge of the extent
| Name | Type | Description |
| --- | --- | --- |
| location | Location | |
location
#### #
getCenter() -> {Location}
Get the center Location of an extent
#### #
intersection(extent) -> {Extent}
Get the intersection with other extent.
| Name | Type | Description |
| --- | --- | --- |
| extent | Extent | |
extent
#### #
intersects(extent) -> {boolean}
Determine if one extent intersects another.
| Name | Type | Description |
| --- | --- | --- |
| extent | Extent | |
extent
================================================================================
## 14. Feature
Class
# Feature
## Feature(geometry)
This class contains functionality shared among geometry objects, such as Point, Line, Polygon, and MultiPolygon.
Features can be styled individually with setStyle; otherwise they use the style of their vector layer.
Learn more about creating features in the Vector Layer tutorial.
setStyle
#### #
new Feature(geometry)
| Name | Type | Description |
| --- | --- | --- |
| geometry | Geometry | Any geometry object: Point, Line, Polygon, MultiPolygon |
geometry
Any geometry object: Point, Line, Polygon, MultiPolygon
**Tutorials:**
: Vector Layer
- Vector Layer
- Feature#event:FEATURE_CLICK
- Feature#event:FEATURE_HOVER
Create simple feature
const location = new Vexcel.Geometry.Location(20, 20);
const point = new Vexcel.Geometry.Point(location);
const feature = new Vexcel.Geometry.Feature(point);
const location = new Vexcel.Geometry.Location(20, 20);
const point = new Vexcel.Geometry.Point(location);
const feature = new Vexcel.Geometry.Feature(point);
### Classes
**Feature**
# Methods
#### #
clone() -> {Feature.}
Clone this feature. If the original feature has a geometry it is also cloned.
The clone
#### #
get(key) -> {any}
Gets a value
| Name | Type | Description |
| --- | --- | --- |
| key | string | |
key
#### #
getBoundingBox() -> {Extent}
Get extent/bounding box for feature geometry in geographic coordinates [minx, miny, maxx, maxy]
bounding box
#### #
getGeometry() -> {Geometry}
Get the feature's default geometry
The geometry for the feature.
#### #
getKeys() -> {Array.}
Get a list of object property names.
List of property names.
#### #
getProperties() -> {Object.}
Get an object of all property names and values.
Object.
#### #
getStyle() -> {Style}
Get the feature's style
The feature style.
#### #
set(key, value)
Sets a value.
| Name | Type | Description |
| --- | --- | --- |
| key | string | Key name. |
| value | any | Value. |
key
Key name.
value
Value.
#### #
setGeometry(geometry)
Set the default geometry for the feature.
| Name | Type | Description |
| --- | --- | --- |
| geometry | Geometry | The new geometry. |
geometry
The new geometry.
#### #
setProperties(values)
Sets a collection of key-value pairs. Note that this changes any existing properties and adds new ones (it does not remove any existing properties).
| Name | Type | Description |
| --- | --- | --- |
| values | Object. | Values. |
values
Values.
#### #
setStyle(styleopt)
Set the style for the feature to override the layer style. This can be a single style object, an array of styles, or a function that takes a resolution and returns an array of styles. To unset the feature style, call setStyle() without arguments or a falsey value.
setStyle()
| Name | Type | Attributes | Description |
| --- | --- | --- | --- |
| style | Style | | Style for this feature. |
style
Style for this feature.
#### #
toGeoJSON() -> {string}
Convert feature geometry to GeoJSON string with xy coordinates [long, lat]
#### #
toWKT() -> {string}
Convert feature geometry to WKT string with xy coordinates [long, lat]
# Events
#### #
FEATURE_CLICK
Event triggered when a feature receives a click
| Name | Type | Description |
| --- | --- | --- |
| location | Location | Location of the coordinates for this event |
| layer | VectorLayer | Layer for this feature |
location
Location of the coordinates for this event
layer
Layer for this feature
Event for click on feature
feature.addListener(Vexcel.Events.MapEvents.FEATURE_CLICK, (e) => {
console.log(JSON.stringify(e.feature));
});
feature.addListener(Vexcel.Events.MapEvents.FEATURE_CLICK, (e) => {
console.log(JSON.stringify(e.feature));
});
#### #
FEATURE_HOVER
Event triggered when hovering over a feature in the map
| Name | Type | Description |
| --- | --- | --- |
| location | Location | Location of the coordinates for this event |
| layer | VectorLayer | Layer for this feature |
| hover | boolean | if the feature is hovered or not.
False it's triggered when pointer does not intersect when the geometry |
location
Location of the coordinates for this event
layer
Layer for this feature
hover
if the feature is hovered or not.
False it's triggered when pointer does not intersect when the geometry
Event for hover on feature
feature.addListener(Vexcel.Events.MapEvents.FEATURE_HOVER, (e) => {
console.log(JSON.stringify(e.feature));
});
feature.addListener(Vexcel.Events.MapEvents.FEATURE_HOVER, (e) => {
console.log(JSON.stringify(e.feature));
});
================================================================================
## 15. Fill
Class
# Fill
## Fill(opts)
Set fill style for vector features.
Learn more about implementing fill style in our Polygon styles, Point styles, Point shapes styles, Feature styles, and Text styles tutorials.
#### #
new Fill(opts)
Initialization object
| Name | Type | Attributes | Default | Description |
| --- | --- | --- | --- | --- |
| opts | object | | | Tile layer options. |
| color | object | | null | A color definition "rgba(red, green, blue, alpha)", "rgb(red, green, blue)" and "#FFFFFF" format supported. |
opts
Tile layer options.
color
A color definition "rgba(red, green, blue, alpha)", "rgb(red, green, blue)" and "#FFFFFF" format supported.
**Tutorials:**
: Polygon styles
Point styles
Point shapes styles
Feature styles
Text styles
- Polygon styles
- Point styles
- Point shapes styles
- Feature styles
- Text styles
### Classes
**Fill**
# Methods
#### #
getColor() -> {string}
Get the stroke color.
A color definition "rgba(red, green, blue, alpha)", "rgb(red, green, blue)" and "#FFFFFF" format supported.
#### #
setColor(color)
Set the color.
| Name | Type | Description |
| --- | --- | --- |
| color | string | A color definition "rgba(red, green, blue, alpha)", "rgb(red, green, blue)" and "#FFFFFF" format supported. |
color
A color definition "rgba(red, green, blue, alpha)", "rgb(red, green, blue)" and "#FFFFFF" format supported.
================================================================================
## 16. GeoJSON
Class
# GeoJSON
## GeoJSON()
Feature format for reading and writing data in the GeoJSON format.
#### #
new GeoJSON()
### Classes
**GeoJSON**
# Methods
#### #
readFeature(geoJSON) -> {Feature}
Read the feature from the GeoJSON geometry object.
| Name | Type | Description |
| --- | --- | --- |
| geoJSON | object | GeoJSON geometry |
geoJSON
GeoJSON geometry
Feature.
#### #
readFeatures(geoJSON) -> {object}
Read the features from the GeoJSON geometry string.
| Name | Type | Description |
| --- | --- | --- |
| geoJSON | object | GeoJSON geometry in geographic coordinates. |
geoJSON
GeoJSON geometry in geographic coordinates.
Features.
#### #
readGeometry(geoJSON) -> {object}
Read the geometry from the GeoJSON geometry string.
| Name | Type | Description |
| --- | --- | --- |
| geoJSON | object | GeoJSON geometry |
geoJSON
GeoJSON geometry
Geometry.
#### #
writeFeature(feature) -> {string}
Encode a feature as a GeoJSON object.
| Name | Type | Description |
| --- | --- | --- |
| feature | Feature | Feature. |
feature
Feature.
Encoded feature.
#### #
writeFeatures(features) -> {string}
Encode an array of features as GeoJSON object.
| Name | Type | Description |
| --- | --- | --- |
| features | Array. | Features. |
features
Features.
Encoded features.
#### #
writeGeometry(geometry) -> {string}
Write a single geometry.
| Name | Type | Description |
| --- | --- | --- |
| geometry | object | geometry. |
geometry
geometry.
Geometry
================================================================================
## 17. GroupLayer
Class
# GroupLayer
## GroupLayer(opts)
Group Layer definition
Learn more about Group Layers in our Group Layer tutorial.
#### #
new GroupLayer(opts)
Initialization object
| Name | Type | Attributes | Default | Description |
| --- | --- | --- | --- | --- |
| opts | object | | | Group layer options. |
| name | string | | | Layer name |
| order | number | | | The order for layer rendering. At rendering time, the layers will be ordered, first by order and then by position. When undefined, a order of 0 is assumed for layers that are added to the map's layers collection. |
| visible | boolean | | true | Visibility |
| layers | Array. | | | Array of layers to be included in the group. |
opts
Group layer options.
name
Layer name
order
The order for layer rendering. At rendering time, the layers will be ordered, first by order and then by position. When undefined, a order of 0 is assumed for layers that are added to the map's layers collection.
visible
Visibility
layers
Array of layers to be included in the group.
**Tutorials:**
: Group Layer
- Group Layer
- LayerEvents#event:VISIBILITY_CHANGE
Create empty layer
const layer = new Vexcel.Layers.GroupLayer();
const layer = new Vexcel.Layers.GroupLayer();
### Extends
- BaseGroupLayer
### Classes
**GroupLayer**
# Methods
#### #
getMaxZoom() -> {number}
Gets the maximum zoom level of the layer.
**Overrides:**
: BaseGroupLayer#getMaxZoom
- BaseGroupLayer#getMaxZoom
The maximum zoom level of the layer.
#### #
getMinZoom() -> {number}
Gets the minimum zoom level of the layer.
**Overrides:**
: BaseGroupLayer#getMinZoom
- BaseGroupLayer#getMinZoom
The minimum zoom level of the layer.
#### #
getOpacity() -> {number}
Gets the opacity of the layer (between 0 and 1).
**Overrides:**
: BaseGroupLayer#getOpacity
- BaseGroupLayer#getOpacity
The opacity of the layer.
#### #
getVisible() -> {boolean}
Return the visibility of the layer (true or false).
true
false
**Overrides:**
: BaseGroupLayer#getVisible
- BaseGroupLayer#getVisible
The visibility of the layer.
#### #
setMaxZoom(maxZoom)
Sets the maximum zoom (exclusive) at which the layer is visible.
Note that the zoom levels for layer visibility are based on the
view zoom level, which may be different from a tile source zoom level.
| Name | Type | Description |
| --- | --- | --- |
| maxZoom | number | The maximum zoom of the layer. |
maxZoom
The maximum zoom of the layer.
**Overrides:**
: BaseGroupLayer#setMaxZoom
- BaseGroupLayer#setMaxZoom
#### #
setMinZoom(minZoom)
Sets the minimum zoom (inclusive) at which the layer is visible.
Note that the zoom levels for layer visibility are based on the
view zoom level, which may be different from a tile source zoom level.
| Name | Type | Description |
| --- | --- | --- |
| minZoom | number | The minimum zoom of the layer. |
minZoom
The minimum zoom of the layer.
**Overrides:**
: BaseGroupLayer#setMinZoom
- BaseGroupLayer#setMinZoom
#### #
setOpacity(opacity)
Sets the opacity of the layer, allowed values range from 0 to 1.
| Name | Type | Description |
| --- | --- | --- |
| opacity | number | The opacity of the layer. |
opacity
The opacity of the layer.
**Overrides:**
: BaseGroupLayer#setOpacity
- BaseGroupLayer#setOpacity
#### #
setVisible(visible)
Set the visibility of the layer (true or false).
true
false
| Name | Type | Description |
| --- | --- | --- |
| visible | boolean | The visibility of the layer. |
visible
The visibility of the layer.
**Overrides:**
: BaseGroupLayer#setVisible
- BaseGroupLayer#setVisible
================================================================================
## 18. HeightTool
Class
# HeightTool
## HeightTool
Measurement tool to draw height.
Learn more about our Height Tool in our 3D mode tutorials.
### Classes
**HeightTool**
# Methods
#### #
activate()
This method activate the tool and you can start to draw a polygon
#### #
cancel()
This method cancel the current measure
#### #
changeHeightUnits(unit)
Sets the height units to be shown by the tool.
| Name | Type | Description |
| --- | --- | --- |
| unit | LengthUnits | Imperial or metric value from LengthUnits |
unit
Imperial or metric value from LengthUnits
**See:**
: LengthUnits
- LengthUnits
#### #
changeTooltipsVisibility(visible)
Change visibility for measurement tooltips
| Name | Type | Description |
| --- | --- | --- |
| visible | boolean | boolean |
visible
boolean
#### #
clear()
This method clears all measurements of this tool.
#### #
deactivate()
This method deactivate the tool
================================================================================
## 19. Icon
Class
# Icon
## Icon(opts)
Set icon style for vector features.
Learn more about implementing Icons in our Point styles and Point shapes styles tutorials
#### #
new Icon(opts)
Initialization object
| Name | Type | Attributes | Default | Description |
| --- | --- | --- | --- | --- |
| opts | object | | | Options |
| rotateWithView | boolean | | | If the image should get rotated with the view. |
| rotation | number | | | Rotation. |
| scale | number | | | Scale. |
| displacement | number | | | Displacement. |
| anchor | Array. | | [0.5, 0.5] | Anchor. Default value is the icon center. |
| color | string | | | Color to tint the icon. If not specified, the icon will be left as is. |
| offset | Array. | | [0, 0] | Offset, which, together with the size and the offset origin, define the
sub-rectangle to use from the original icon image. |
| displacement | Array. | | [0,0] | Displacement the icon |
| offsetOrigin | string | | 'top-left' | Origin of the offset: bottom-left, bottom-right,
top-left or top-right. |
| opacity | number | | 1 | Opacity of the icon. |
| scale | number | | 1 | Scale. |
| rotateWithView | boolean | | false | Whether to rotate the icon with the view. |
| rotation | number | | 0 | Rotation in radians (positive rotation clockwise). |
| size | number | | | Icon size in pixel. Can be used together with offset to define the
sub-rectangle to use from the origin (sprite) icon image. |
| imgSize | number | | | Image size in pixels. Only required if img is set and src is not, and
for SVG images in Internet Explorer 11. The provided imgSize needs to match the actual size of the image. |
| src | string | | | Image source URI. |
opts
Options
rotateWithView
If the image should get rotated with the view.
rotation
Rotation.
scale
Scale.
displacement
Displacement.
anchor
Anchor. Default value is the icon center.
color
Color to tint the icon. If not specified, the icon will be left as is.
offset
Offset, which, together with the size and the offset origin, define the
sub-rectangle to use from the original icon image.
displacement
Displacement the icon
offsetOrigin
Origin of the offset: bottom-left, bottom-right,
top-left or top-right.
bottom-left
bottom-right
top-left
top-right
opacity
Opacity of the icon.
scale
Scale.
rotateWithView
Whether to rotate the icon with the view.
rotation
Rotation in radians (positive rotation clockwise).
size
Icon size in pixel. Can be used together with offset to define the
sub-rectangle to use from the origin (sprite) icon image.
offset
imgSize
Image size in pixels. Only required if img is set and src is not, and
for SVG images in Internet Explorer 11. The provided imgSize needs to match the actual size of the image.
img
src
imgSize
src
Image source URI.
**Tutorials:**
: Point styles
Point shapes styles
- Point styles
- Point shapes styles
### Classes
**Icon**
# Methods
#### #
getAnchor() -> {Array.}
Get the anchor point in pixels. The anchor determines the center point for the
symbolizer.
Anchor.
#### #
getDisplacement() -> {Array.}
Get the displacement of the shape
Shape's center displacement
#### #
getFill() -> {Fill}
Get the fill style for the shape.
Fill style.
#### #
getOpacity() -> {number}
Get the symbolizer opacity.
Opacity.
#### #
getRotateWithView() -> {boolean}
Determine whether the symbolizer rotates with the map.
Rotate with map.
#### #
getRotation() -> {number}
Get the symoblizer rotation.
Rotation.
#### #
getScale() -> {number}
Get the symbolizer scale.
Scale.
#### #
getSize() -> {Array.}
Get the size of the symbolizer (in pixels).
Size.
#### #
getSrc() -> {string}
Get the image URL.
Image src.
#### #
getStroke() -> {Stroke}
Get the stroke style for the shape.
Stroke style.
#### #
setOpacity(opacity)
Set the opacity.
| Name | Type | Description |
| --- | --- | --- |
| opacity | number | Opacity. |
opacity
Opacity.
#### #
setRotateWithView(rotateWithView)
Set whether to rotate the style with the view.
| Name | Type | Description |
| --- | --- | --- |
| rotateWithView | boolean | Rotate with map. |
rotateWithView
Rotate with map.
#### #
setRotation(rotation)
Set the rotation.
| Name | Type | Description |
| --- | --- | --- |
| rotation | number | Rotation. |
rotation
Rotation.
#### #
setScale(scale)
Set the scale.
| Name | Type | Description |
| --- | --- | --- |
| scale | number | Scale. |
scale
Scale.
================================================================================
## 20. Image
Class
# Image
## Image
Represents an image object containing metadata.
This class provides structured access to various image properties, including
capture details, positioning, and sensor specifications.
### Classes
**Image**
# Members
#### #
archived
Archive status of the image.
#### #
area
Area covered by the image.
#### #
b1
Band coefficient b1.
#### #
b2
Band coefficient b2.
#### #
band
Band of the image.
#### #
bboxWkt
Bounding box WKT.
#### #
bboxWktLatlon
Bounding box WKT in lat/lon coordinates.
#### #
cameraPosX
X position of the camera.
#### #
cameraPosY
Y position of the camera.
#### #
cameraTechnology
Camera technology used to capture the image.
#### #
cameraZ
Z position of the camera.
#### #
captureDate
Capture date of the image.
#### #
captureYear
Year of image capture.
#### #
centreWkt
Centre point WKT.
#### #
centreWktLatlon
Centre point WKT in lat/lon coordinates.
#### #
childAoi
Child area of interest (AOI).
#### #
firstCaptureDate
Date of the first image capture.
#### #
firstPublishDate
First date the image was published.
#### #
flightLineId
Flight line ID associated with the image.
#### #
focalLength
Focal length of the camera used to capture the image.
#### #
groundZ
Ground Z position (altitude).
#### #
gsd
Ground Sample Distance (GSD) for the image.
#### #
imageId
Unique identifier for the image.
#### #
k0
Calibration coefficient k0.
#### #
k1
Calibration coefficient k1.
#### #
k2
Calibration coefficient k2.
#### #
k3
Calibration coefficient k3.
#### #
kappa
Kappa angle of the image.
#### #
lastCaptureDate
Date of the last image capture.
#### #
lastPublishDate
Last date the image was published.
#### #
layerName
Layer name of the image.
#### #
maxGsd
Maximum Ground Sample Distance (GSD) for the image.
#### #
minGsd
Minimum Ground Sample Distance (GSD) for the image.
#### #
omega
Omega angle of the image.
#### #
orientation
Orientation of the image.
#### #
originalImageName
Original image file name.
#### #
originalShotId
Original shot ID.
#### #
p1
Calibration coefficient p1.
#### #
p2
Calibration coefficient p2.
#### #
phi
Phi angle of the image.
#### #
pixelSize
Pixel size of the image.
#### #
pp0X
Principal point X of the camera.
#### #
pp0Y
Principal point Y of the camera.
#### #
projectExt
Project extension.
#### #
projectName
Project name associated with the image.
#### #
rasterSizeHeight
Raster size height.
#### #
rasterSizeWidth
Raster size width.
#### #
utmZone
UTM zone of the image.
#### #
zIndex
Z-index value for image layer sorting.
================================================================================
## 21. ImageryLayer
Class
# ImageryLayer
## ImageryLayer
Represents a specialized map layer for displaying imagery data.
Provides functionality to interact with imagery in both 2D and 3D modes,
including changing view modes, adjusting opacity and visibility,
retrieving metadata, and managing infrared mode.
### Classes
**ImageryLayer**
# Methods
#### #
changeImage3D(id)
Loads a 3D image by its image ID.
| Name | Type | Description |
| --- | --- | --- |
| id | string | The ID of the image to load in 3D mode. |
id
The ID of the image to load in 3D mode.
#### #
changeMode(mode) -> {Promise.<{status: number, msg: string}>}
Changes the view mode of the map.
| Name | Type | Description |
| --- | --- | --- |
| mode | '3D'
|
'2D' | The mode to switch to. |
mode
The mode to switch to.
- A promise resolving with the operation status and message, or rejecting on failure.
#### #
changeOrientation(orientation) -> {Promise.<{status: number, msg: string}>}
Changes the imagery orientation in 3D mode.
| Name | Type | Description |
| --- | --- | --- |
| orientation | string | The orientation to change to. |
orientation
The orientation to change to.
- A promise resolving with the operation status and message, or rejecting if 3D mode is not active.
#### #
disableInfrared()
Disables infrared mode.
#### #
enableInfrared()
Enables infrared mode.
#### #
getAvailableLayerCollections() -> {Array.}
Get all collections in center separated by layer collections.
#### #
getCenterImageMetadata() -> {Image}
Retrieves metadata of the images at the center of the view.
The image metadata.
#### #
getLayerCollections() -> {Array.}
Get all collections separated by layer collections.
#### #
getMaxZoom() -> {number}
Gets the maximum zoom level of the layer.
The maximum zoom level of the layer.
#### #
getMinZoom() -> {number}
Gets the minimum zoom level of the layer.
The minimum zoom level of the layer.
#### #
getMode() -> {'3D'|'2D'}
Get the mode of the map.
mode for current view
#### #
getOpacity() -> {number}
Gets the opacity of the layer (between 0 and 1).
The opacity of the layer.
#### #
getOrientation() -> {string}
Return view orientation
#### #
getVisible() -> {boolean}
Gets the visibility of the layer (true or false).
true
false
The visibility of the layer.
#### #
hasInfrared() -> {boolean}
Checks if infrared imagery is available in the current mode.
- Returns true if infrared imagery is available, otherwise false.
true
false
#### #
hideVexcelSources(vexcelLayers)
Sets the sources for removing in the base Imagery Layer
| Name | Type | Description |
| --- | --- | --- |
| vexcelLayers | Array. | List of layer sources to remove. Should be values from VexcelLayers |
vexcelLayers
List of layer sources to remove. Should be values from VexcelLayers
#### #
is3DAvailable(collectionIdopt, centeropt, zoomopt) -> {boolean}
Checks if 3D mode is available for a specific collection, center, and zoom level.
If center or zoom are not specified or are null, the function will use the map's current center and zoom.
center
zoom
null
| Name | Type | Attributes | Default | Description |
| --- | --- | --- | --- | --- |
| collectionId | string | | null | The ID of the collection to check. If not provided, it will check all available collections. |
| center | Location | | null | The geographical center [longitude, latitude] to check for 3D availability. Defaults to the map's current center if not provided. |
| zoom | number | | null | The zoom level to check for 3D mode. Defaults to the map's current zoom if not provided. |
collectionId
The ID of the collection to check. If not provided, it will check all available collections.
center
The geographical center [longitude, latitude] to check for 3D availability. Defaults to the map's current center if not provided.
zoom
The zoom level to check for 3D mode. Defaults to the map's current zoom if not provided.
- Returns true if 3D mode is available, otherwise false.
true
false
#### #
isOrientationAvailable(orientation, collectionIdopt) -> {boolean}
Checks whether orientation is available for the given collection (if specified).
| Name | Type | Attributes | Default | Description |
| --- | --- | --- | --- | --- |
| orientation | string | | | The orientation to check. Defaults to the map's current orientation if not provided. |
| collectionId | string
|
null | | null | The ID of the collection to check. If null, checks globally. |
orientation
The orientation to check. Defaults to the map's current orientation if not provided.
collectionId
The ID of the collection to check. If null, checks globally.
null
- Returns true if the orientation is available, otherwise false.
true
false
#### #
loadDiscreteByProject(layerCollection, collectionId)
Loads discrete imagery by project.
| Name | Type | Description |
| --- | --- | --- |
| layerCollection | string | The layer collections identifier. |
| collectionId | string | The collection name. |
layerCollection
The layer collections identifier.
collectionId
The collection name.
#### #
selectCollection(id)
Selects a collection to be displayed in the imagery.
| Name | Type | Description |
| --- | --- | --- |
| id | string | The collection to set on top. |
id
The collection to set on top.
#### #
setMaxZoom(maxZoom)
Sets the maximum zoom (exclusive) at which the layer is visible.
Note that the zoom levels for layer visibility are based on the
view zoom level, which may be different from a tile source zoom level.
| Name | Type | Description |
| --- | --- | --- |
| maxZoom | number | The maximum zoom of the layer. |
maxZoom
The maximum zoom of the layer.
#### #
setMinZoom(minZoom)
Sets the minimum zoom (inclusive) at which the layer is visible.
Note that the zoom levels for layer visibility are based on the
view zoom level, which may be different from a tile source zoom level.
| Name | Type | Description |
| --- | --- | --- |
| minZoom | number | The minimum zoom of the layer. |
minZoom
The minimum zoom of the layer.
#### #
setOpacity(opacity)
Sets the opacity of the layer, allowed values range from 0 to 1.
| Name | Type | Description |
| --- | --- | --- |
| opacity | number | The opacity of the layer. |
opacity
The opacity of the layer.
#### #
setVisible(visible)
Sets the visibility of the layer (true or false).
true
false
| Name | Type | Description |
| --- | --- | --- |
| visible | boolean | The visibility of the layer. |
visible
The visibility of the layer.
#### #
showVexcelSources(vexcelLayers)
Sets the sources for the base Imagery Layer to the specified list, removing all others
| Name | Type | Description |
| --- | --- | --- |
| vexcelLayers | Array. | List of layer sources to keep. Should be values from VexcelLayers |
vexcelLayers
List of layer sources to keep. Should be values from VexcelLayers
================================================================================
## 22. InfoBox
Class
# InfoBox
## InfoBox(options)
An element to be displayed over the map and attached to a single map location. Overlays are visible widgets,
they are not in a fixed position on the screen, but are tied to a geographical coordinate,
so panning the map will move an Overlay but not a Control.
Learn how to implement an InfoBox in our InfoBox fixed and InfoBox on click tutorials.
#### #
new InfoBox(options)
| Name | Type | Attributes | Description |
| --- | --- | --- | --- |
| options | options | | Extend Overlay options |
| location | Location | | Location object with the coordinates for popup |
| content | string | | Html content to show in the info popup |
| class | String | | the a class of the overlay to style the popup. |
| anim | boolean | | Animate the popup the popup, default false. |
| closeBox | bool | | popup has a close box, default false. |
| onclose | function
|
undefined | | callback function when infobox is closed |
| onshow | function
|
undefined | | callback function when infobox is shown |
| offsetBox | Number
|
Array. | | an offset box |
| positioning | string | | the 'auto' positioning var the popup choose its positioning to stay on the map. Possible values are 'bottom-left', 'bottom-center', 'bottom-right',
'center-left', 'center-center', 'center-right', 'top-left',
'top-center', and 'top-right'. |
options
Extend Overlay options
location
Location object with the coordinates for popup
content
Html content to show in the info popup
class
the a class of the overlay to style the popup.
anim
Animate the popup the popup, default false.
closeBox
popup has a close box, default false.
onclose
callback function when infobox is closed
onshow
callback function when infobox is shown
offsetBox
an offset box
positioning
the 'auto' positioning var the popup choose its positioning to stay on the map. Possible values are 'bottom-left', 'bottom-center', 'bottom-right',
'center-left', 'center-center', 'center-right', 'top-left',
'top-center', and 'top-right'.
'bottom-left'
'bottom-center'
'bottom-right'
'center-left'
'center-center'
'center-right'
'top-left'
'top-center'
'top-right'
### Classes
**InfoBox**
# Methods
#### #
hide()
Hide and remove from map
#### #
show(locationopt, contentopt)
Set the position and the content of the popup.
| Name | Type | Attributes | Description |
| --- | --- | --- | --- |
| location | Location | | Location object with the coordinates for popup |
| content | string | | Html content to show in the info popup |
location
Location object with the coordinates for popup
content
Html content to show in the info popup
================================================================================
## 23. LayerCollections
Class
# LayerCollections
## LayerCollections
Represents a layer collections, including its name and the associated collections.
This class provides structured access to layer collections information, organizing
collections under a specific program and enabling management of geospatial imagery data.
### Classes
**LayerCollections**
# Members
#### #
collections
Collections of layer collections.
#### #
name
Layer collections name.
================================================================================
## 24. LayerCollectionsStatus
Class
# LayerCollectionsStatus
## LayerCollectionsStatus
Represents a layer collections with associated status, including the program name,
relevant view information (such as center, zoom, and extent), and the collections under this program.
This class extends the functionality of the basic LayerCollections by adding dynamic status
related to collections and their orientations, enabling more detailed management of geospatial imagery.
LayerCollections
### Classes
**LayerCollectionsStatus**
# Members
#### #
collections
Available collections.
#### #
name
Layer collections name.
#### #
viewInfo
Relevant info for center, zoom and extent
================================================================================
## 25. LayerEvents
Namespace
# LayerEvents
## LayerEvents
This namespace contains definitions for events related to layers.
### Namespaces
**LayerEvents**
# Events
#### #
VISIBILITY_CHANGE
Event triggered when layer changes it visibility
| Name | Type | Description |
| --- | --- | --- |
| layer | BaseLayer | Layer that changed visibility |
| visible | boolean | New visibility state |
layer
Layer that changed visibility
visible
New visibility state
Event for layer visibility change
layer.addListener('layer:visibility:change', (e) => {
console.log(e.visible);
});
layer.addListener('layer:visibility:change', (e) => {
console.log(e.visible);
});
================================================================================
## 26. Line
Class
# Line
## Line(locations)
The line class allows you to draw connected lines on a map. In many spatial database systems,
these are called PolyLines, or LineStrings.
When creating a polyline, an array of locations must be passed as an argument in the constructor.
See an implementation in our Line tutorial.
#### #
new Line(locations)
| Name | Type | Description |
| --- | --- | --- |
| locations | Array. | array of locations. |
locations
array of locations.
**Tutorials:**
: Line
- Line
Create simple line
const line = new Vexcel.Geometry.Line(
[
new Vexcel.Geometry.Location(30.770159115784214, -86.6162109375),
new Vexcel.Geometry.Location(31.914867503276223, -88.57177734375),
new Vexcel.Geometry.Location(33.50475906922609, -87.2094726562),
]);
const line = new Vexcel.Geometry.Line(
[
new Vexcel.Geometry.Location(30.770159115784214, -86.6162109375),
new Vexcel.Geometry.Location(31.914867503276223, -88.57177734375),
new Vexcel.Geometry.Location(33.50475906922609, -87.2094726562),
]);
### Classes
**Line**
# Methods
#### #
clone() -> (non-null) {Line}
Make a complete copy of the line.
Clone
#### #
getLength() -> {number}
Return the length of the polyline on projected plane.
Length (on projected plane).
#### #
getLocations() -> {Array.}
Returns the locations that define the polyline.
array with location object with latitude and longitude
#### #
getType() -> {object}
Get the type of this geometry.
Geometry type.
#### #
setLocations(locations)
Update polyline locations.
| Name | Type | Description |
| --- | --- | --- |
| locations | Array. | Array of Location objects |
locations
Array of Location objects
#### #
toGeoJSON() -> {string}
Convert geometry to GeoJSON string with xy coordinates [long, lat]
#### #
toWKT() -> {string}
Convert geometry to WKT string with xy coordinates [long, lat]
================================================================================
## 27. LineTool
Class
# LineTool
## LineTool
Measurement tool to draw lines.
Learn more about our Line Tool in our 2D mode and 3D mode tutorials.
### Classes
**LineTool**
# Methods
#### #
activate()
This method activate the tool and you can start to draw a polygon
#### #
cancel()
This method cancel the current measure
#### #
changeLengthUnits(unit)
Sets the length units to be shown by the tool.
| Name | Type | Description |
| --- | --- | --- |
| unit | LengthUnits | Imperial or metric value from LengthUnits |
unit
Imperial or metric value from LengthUnits
**See:**
: LengthUnits
- LengthUnits
#### #
changeSlopeUnits(unit)
Sets the slope units to be shown by the tool.
| Name | Type | Description |
| --- | --- | --- |
| unit | SlopeUnits | Imperial or metric value from SlopeUnits |
unit
Imperial or metric value from SlopeUnits
**See:**
: SlopeUnits
- SlopeUnits
#### #
changeTooltipsVisibility(visible)
Change visibility for measurement tooltips
| Name | Type | Description |
| --- | --- | --- |
| visible | boolean | boolean |
visible
boolean
#### #
clear()
This method clears all measurements of this tool.
#### #
deactivate()
This method deactivate the tool
#### #
disableEdit()
This method disable de edit mode for this tool
#### #
enableEdit()
This method enable de edit mode for this tool
================================================================================
## 28. Location
Class
# Location
## Location(latitude, longitude)
This class stores the coordinate information needed to mark locations on a map.
The Location class consists of two properties: latitude and longitude.
The latitude property is used to represent how far north or south a location is.
This value is an angle measured around the center of the earth from the equator towards the poles.
A positive value is in the northern hemisphere and a negative value is in the southern hemisphere.
This value has a range of -90 to 90 degrees however due to the mathematics involved in representing the
spherical globe as a flat 2D map, some calculations approach infinity as you approach polar latitudes.
To avoid this, mapping platforms that use the Mercator projection system clip the latitude
coordinates to approximately -85 and 85 degrees.
The longitude property stores the angle of horizontal offset from the prime meridian (0 degrees).
This property has a value between -180 and 180 degrees.
#### #
new Location(latitude, longitude)
| Name | Type | Description |
| --- | --- | --- |
| latitude | number | The latitude of the location. |
| longitude | number | The longitude of the location. |
latitude
The latitude of the location.
longitude
The longitude of the location.
Create simple location object
const point = new Vexcel.Geometry.Location(20,20);
const point = new Vexcel.Geometry.Location(20,20);
### Classes
**Location**
# Methods
#### #
clone() -> (non-null) {Location}
Make a complete copy of the Location.
Clone.
#### #
toString() -> {string}
Return latitude,longitude in a comma-delimited string format
================================================================================
## 29. Login
# Login
You need to login to check the Vexcel API documentation and
tutorials
- Email:
- Password:
- Login
- Login
- Token:
- Login
================================================================================
## 30. Map
Class
# Map
## Map(opts)
The map object generates an interactive map. You can customize the map by passing in number of different
options. Some of these options can be specified when creating the map while others can be changed at any time.
When loading the map, you can specify settings from the MapOptions.
Learn more about initializing maps with our map tutorial
#### #
new Map(opts)
Generate object with options. You must provide at least one of the following parameters: token, apiKey, geoKey, or impersonationKey.
token
apiKey
geoKey
impersonationKey
| Name | Type | Attributes | Default | Description |
| --- | --- | --- | --- | --- |
| opts | object | | | Map core options. |
| target | string | | | Div name where interactive map will reside |
| token | number | | | The authentication token, required if no other authentication method is provided. |
| apiKey | number | | | The authentication api key, required if no other authentication method is provided. |
| geoKey | number | | | The authentication geo key, required if no other authentication method is provided. |
| impersonationKey | number | | | The authentication impersonation key, required if no other authentication method is provided. |
| mapId | target | | | Map Id. IMPORTANT. If no ID is informed, the used map will be the first map assigned to the user ordered alphabetically. |
| center | Array. | | | The initial center for the view. |
| zoom | number | | | Zoom level for the view. |
| maxZoom | number | | | The maximum zoom level used to determine the resolution constraint. |
| minZoom | number | | | The minimum zoom level used to determine the resolution constraint. |
| mode | string | | "2D" | Initial mode in which the map will be initialized |
| image | string | | | Initial image in which the map will be initialized, necessary 3D mode |
| orientation | string | | "N" | Initial orientation in which the map will be initialized |
| layerSwitcher | boolean | | false | Add built-in layer switcher control to the map. |
| zoomControl | boolean | | false | Add built-in zoom control to the map. |
| initialConfig | Map~InitOpts | | {overlays:null,imageryLayers:null,center:true,zoom:true,callback:null} | Object to establish which map config it´s applied. |
| restrictedExtent | Extent | | | The extent that the map will be restricted to. |
opts
Map core options.
target
Div name where interactive map will reside
token
The authentication token, required if no other authentication method is provided.
apiKey
The authentication api key, required if no other authentication method is provided.
geoKey
The authentication geo key, required if no other authentication method is provided.
impersonationKey
The authentication impersonation key, required if no other authentication method is provided.
mapId
Map Id. IMPORTANT. If no ID is informed, the used map will be the first map assigned to the user ordered alphabetically.
center
The initial center for the view.
zoom
Zoom level for the view.
maxZoom
The maximum zoom level used to determine the resolution constraint.
minZoom
The minimum zoom level used to determine the resolution constraint.
mode
Initial mode in which the map will be initialized
image
Initial image in which the map will be initialized, necessary 3D mode
orientation
Initial orientation in which the map will be initialized
layerSwitcher
Add built-in layer switcher control to the map.
zoomControl
Add built-in zoom control to the map.
initialConfig
Object to establish which map config it´s applied.
restrictedExtent
The extent that the map will be restricted to.
**Tutorials:**
: Initialization
Init with username/password
Init with constrained zoom levels
Init with token
Init empty map
Init in 3D mode
Init map with a restricted extent
- Initialization
- Init with username/password
- Init with constrained zoom levels
- Init with token
- Init empty map
- Init in 3D mode
- Init map with a restricted extent
- Map#event:CENTER_DATE_IMAGE
- Map#event:CHANGE_MEASURE
- Map#event:CLICK
- Map#event:FEATURES_CLICK
- Map#event:FIND_IMAGES_LOADED
- Map#event:FINISH_MEASURE
- Map#event:MAP_INITIALIZE
- Map#event:MAP_VISIBILITY_CHANGE
- Map#event:MOVE_END
- Map#event:START_MEASURE
- Map#event:TILES_END_LOAD
- Map#event:TILES_START_LOAD
Create basic map. Always need at least a target container and token
const map = new Vexcel.Map({
target: "map",
token: API_KEY,
});
const map = new Vexcel.Map({
target: "map",
token: API_KEY,
});
### Classes
**Map**
# Methods
#### #
addControl(control)
Add custom control to the map
| Name | Type | Description |
| --- | --- | --- |
| control | object | Element to add to the map |
control
Element to add to the map
#### #
addInfoBox(infobox)
Add the given infobox to the map. If the infobox has a location we show in the map if not you can show when you need
with the function InfoBox~show
| Name | Type | Description |
| --- | --- | --- |
| infobox | InfoBox | Add the given infobox to the map. |
infobox
Add the given infobox to the map.
#### #
changeMap(mapId)
Change map.
| Name | Type | Description |
| --- | --- | --- |
| mapId | number | Map Id. IMPORTANT. If no ID is informed, the used map will be the first instance assigned to the user ordered alphabetically. |
mapId
Map Id. IMPORTANT. If no ID is informed, the used map will be the first instance assigned to the user ordered alphabetically.
CoreMap
#### #
changeMode(mode) -> {Promise.}
Change map mode 2d/3d
Select the collection in the top and change mode
When change to 2d we force North orientation
When change to 3d we persist the view orientation
| Name | Type | Description |
| --- | --- | --- |
| mode | string | value from ViewMode |
mode
value from ViewMode
#### #
getBrightness() -> {number}
Returns the brightness value of the Geomni BASE_LINE when is the base layer.
If the base layer is not Geomni BASE_LINE return -1.
The default brightness value of Geomni BASE_LINE layer is 100.
A value in the range [0-500]
#### #
getCollectionManager() -> {CollectionManager}
Get collection manager
#### #
getImageryLayer() -> {ImageryLayer}
Get imagery layer object that manage the imagery data
#### #
getLocation() -> {Location}
Gets the geographic coordinates of center of the view.
#### #
getMapStatusView() -> {MapStatusView}
Get map status view that allow to visualize the status of the map
#### #
getMeasurementManager() -> {MeasurementLayer}
Get measurement manager object that manage measurement tools
#### #
getOverlayManager() -> {OverlayManager}
Get overlay manager object that manage map layers
#### #
getViewExtent() -> {Extent}
Get the extent for the current view state.
**See:**
: Extent
- Extent
#### #
getZoom() -> {number}
Get the current zoom level. This method may return non-integer zoom levels if the view does not constrain the resolution, or if an interaction or animation is underway.
#### #
setBrightness(brightness)
Sets the brightness value of the Geomni BASE_LINE when is the base layer.
| Name | Type | Description |
| --- | --- | --- |
| brightness | number | A value in the range [0-500].
The default brightness value of Geomni BASE_LINE layer is 100; |
brightness
A value in the range [0-500].
The default brightness value of Geomni BASE_LINE layer is 100;
#### #
setCenter(center, EPSG)
Centers the map in the given point.
| Name | Type | Description |
| --- | --- | --- |
| center | Array. | The point with the new coordinates where the map will be centered [lat, lng]. |
| EPSG | string | epsg code "epsg:4326" by default |
center
The point with the new coordinates where the map will be centered [lat, lng].
EPSG
epsg code "epsg:4326" by default
#### #
setLocation(location)
Centers the map in the given point.
| Name | Type | Description |
| --- | --- | --- |
| location | Location | |
location
#### #
setViewExtent(extent)
Fit to extent, move the map to fit this extent
| Name | Type | Description |
| --- | --- | --- |
| extent | Extent | |
extent
**See:**
: Extent
- Extent
#### #
setZoom(zoom)
Zoom to a specific zoom level
| Name | Type | Description |
| --- | --- | --- |
| zoom | number | |
zoom
# Type Definitions
#### #
InitOpts
| Name | Type | Attributes | Default | Description |
| --- | --- | --- | --- | --- |
| overlays | Map~VisibilityConfig | | null | Overlays visibility config at start. |
| imageryLayers | Map~VisibilityConfig | | null | ImageryLayers visibility config at start. Value from VexcelLayers |
| center | boolean | | true | Use center defined in instance config. Use over map config. |
| zoom | boolean | | true | Use zoom defined in instance config. Use over map config. |
| callback | function | | | Callback called when the map finish the initialization. |
overlays
Overlays visibility config at start.
imageryLayers
ImageryLayers visibility config at start. Value from VexcelLayers
center
Use center defined in instance config. Use over map config.
zoom
Use zoom defined in instance config. Use over map config.
callback
Callback called when the map finish the initialization.
#### #
VisibilityConfig
| Name | Type | Attributes | Default | Description |
| --- | --- | --- | --- | --- |
| visible | Array. | | null | Names visible at start. |
| disabled | Array. | | null | Names invisible at start. |
visible
Names visible at start.
disabled
Names invisible at start.
# Events
Type:
object
#### #
CENTER_DATE_IMAGE
Event triggered when center image change
Type:
object
#### #
CHANGE_MEASURE
Event triggered after creating or editing a new measurement with the measurement tools
| Name | Type | Description |
| --- | --- | --- |
| event | object | Internal event |
event
Internal event
| Name | Type | Description |
| --- | --- | --- |
| measure | Measure | Measure object |
measure
Measure object
Type:
object
#### #
CLICK
Event Triggered when user single clicks on the map. This event is not triggered if drawing tools are enabled or if the user clicks on a feature on the map.
| Name | Type | Description |
| --- | --- | --- |
| location | Location | Location of the coordinates for this event |
| drawing | boolean | Return if any of drawing/measurement tools are enabled |
location
Location of the coordinates for this event
drawing
Return if any of drawing/measurement tools are enabled
#### #
COMPLETE_COLLECTIONS
Event triggered when map loads all collections
Type:
object
#### #
FEATURES_CLICK
Event Triggered when user clicks on a space on the map occupied by multiple features. Only fired if there is more than one feature
| Name | Type | Description |
| --- | --- | --- |
| location | Location | Location for point clicked |
| features | Array. | List of features when you click |
location
Location for point clicked
features
List of features when you click
Listener in map to listen on features click
core.addListener(Vexcel.Events.MapEvents.FEATURES_CLICK, (e) => {
e.features.map(feat => console.log(JSON.stringify(feat)));
});
}
});
core.addListener(Vexcel.Events.MapEvents.FEATURES_CLICK, (e) => {
e.features.map(feat => console.log(JSON.stringify(feat)));
});
}
});
Type:
object
#### #
FIND_IMAGES_LOADED
Event triggered after map loads images for the center of the map in the viewport
| Name | Type | Description |
| --- | --- | --- |
| images | Array. | List of images loaded for the center of the map |
| point | Array. | Point of the center of the image |
| epsg | string | Epsg code for point coordinates |
images
List of images loaded for the center of the map
point
Point of the center of the image
epsg
Epsg code for point coordinates
Type:
object
#### #
FINISH_MEASURE
Event triggered after finish a new measurement with the measurement tools
| Name | Type | Description |
| --- | --- | --- |
| event | object | Internal event |
event
Internal event
| Name | Type | Description |
| --- | --- | --- |
| measure | Measure | Measure object |
measure
Measure object
Type:
object
#### #
MAP_INITIALIZE
Event triggered after map is initialized and layers are loaded
| Name | Type | Description |
| --- | --- | --- |
| map | Map | Map object |
| status | MapStatus~status | Object with the status of the map |
map
Map object
status
Object with the status of the map
Type:
object
#### #
MAP_STATUS_EVENT
Dispatches a map status update event.
| Name | Type | Description |
| --- | --- | --- |
| status | MapStatus | The updated map status. |
status
The updated map status.
- event:MapStatusEvent
Type:
object
#### #
MAP_VISIBILITY_CHANGE
Event triggered when the layer switcher change layers visibility, only works when layer switcher is enabled
| Name | Type | Description |
| --- | --- | --- |
| layer | BaseLayer | Layer that changed visibility |
| visible | boolean | New visibility state |
layer
Layer that changed visibility
visible
New visibility state
Type:
object
#### #
MOVE_END
Event Triggered after the map is moved.
Type:
object
#### #
NO_3D_IMAGES
Event triggered when no images to 3D mode
Type:
object
#### #
POINTER_MOVE
Event triggered when a pointer is moved. Note that on touch devices this is triggered when the map is panned, so it is not the same as moving the mouse.
| Name | Type | Description |
| --- | --- | --- |
| location | Location | Location for point |
location
Location for point
Type:
object
#### #
START_MEASURE
Event triggered after start a new measurement with the measurement tools
| Name | Type | Description |
| --- | --- | --- |
| event | object | Internal event |
event
Internal event
| Name | Type | Description |
| --- | --- | --- |
| measure | Measure | Measure object |
measure
Measure object
#### #
TILES_END_LOAD
Event triggered when the map finishes loading the tiles
#### #
TILES_START_LOAD
Event triggered when the map starts loading the tiles
================================================================================
## 31. MapStatus
Class
# MapStatus
## MapStatus
Map Status object containing position view (center, zoom and extent), available images and visible collection
- MapStatus#event:MAP_STATUS_EVENT
### Classes
**MapStatus**
# Members
#### #
availableLayerCollections
Available layer collections.
#### #
images
Available images.
#### #
viewInfo
Contains position of the map (center, zoom and extent).
#### #
visibleCollection
Visible collection.
# Type Definitions
#### #
ViewInfo
Map status with the relevant info for center, zoom and extent
| Name | Type | Description |
| --- | --- | --- |
| extent | Array. | Extent for map view |
| center | Location | Coordinates for map center |
| zoom | number | Zoom level |
extent
Extent for map view
center
Coordinates for map center
zoom
Zoom level
================================================================================
## 32. MapStatusView
Class
# MapStatusView
## MapStatusView
Represents the current state of the map, including position, zoom level, available layer collections, images, and the visible collection.
### Extends
- BaseObject
### Classes
**MapStatusView**
# Methods
#### #
getAvailableLayerCollections() -> {Array.|null}
Gets the available layer collections in the map.
An array of layer collections, or null if unavailable.
null
#### #
getCenter() -> {Location|null}
Gets the current center coordinates of the map.
The center coordinates as Location, or null if unavailable.
null
#### #
getExtent() -> {Array.|null}
Gets the current map extent.
The map extent as [minX, minY, maxX, maxY], or null if unavailable.
null
#### #
getImages() -> {Array.|null}
Gets the images currently loaded on the map.
An array of image objects, or null if unavailable.
null
#### #
getMapStatus() -> {MapStatus|null}
Gets the current map status.
The map status.
#### #
getVisibleCollection() -> {CollectionStatus|null}
Gets the currently visible collection.
The visible collection object, or null if unavailable.
null
#### #
getZoom() -> {number|null}
Gets the current zoom level of the map.
The zoom level, or null if unavailable.
null
================================================================================
## 33. Measure
Class
# Measure
## Measure
Measure object that extends from Feature.
Learn more about Measurements in our 2D mode and 3D mode tutorials.
- Measure#event:FEATURE_CLICK
- Feature#event:FEATURE_CLICK
- Measure#event:FEATURE_HOVER
- Feature#event:FEATURE_HOVER
### Extends
- Feature
### Classes
**Measure**
# Methods
#### #
clone() -> {Measure}
Clone this feature. If the original feature has a geometry it
is also cloned.
**Overrides:**
: Feature#clone
- Feature#clone
The clone.
#### #
get(key) -> {any}
Gets a value
| Name | Type | Description |
| --- | --- | --- |
| key | string | |
key
**Overrides:**
: Feature#get
- Feature#get
#### #
getBoundingBox() -> {Extent}
Get extent/bounding box for feature geometry in geographic coordinates [minx, miny, maxx, maxy]
**Overrides:**
: Feature#getBoundingBox
- Feature#getBoundingBox
bounding box
#### #
getGeometry() -> {Geometry}
Get the feature's default geometry
**Overrides:**
: Feature#getGeometry
- Feature#getGeometry
The geometry for the feature.
#### #
getKeys() -> {Array.}
Get a list of object property names.
**Overrides:**
: Feature#getKeys
- Feature#getKeys
List of property names.
#### #
getMeasurementInfo() -> {Measure~Data}
Get all measurement info for this measure
measurement info for this shape
#### #
getProperties() -> {Object.}
Get an object of all property names and values.
**Overrides:**
: Feature#getProperties
- Feature#getProperties
Object.
#### #
getStyle() -> {Style}
Get the feature's style
**Overrides:**
: Feature#getStyle
- Feature#getStyle
The feature style.
#### #
getType() -> {string}
Return type of measure the values could be some of this ViewMode
ViewMode
#### #
set(key, value)
Sets a value.
| Name | Type | Description |
| --- | --- | --- |
| key | string | Key name. |
| value | any | Value. |
key
Key name.
value
Value.
**Overrides:**
: Feature#set
- Feature#set
#### #
setGeometry(geometry)
Set the default geometry for the feature.
| Name | Type | Description |
| --- | --- | --- |
| geometry | Geometry | The new geometry. |
geometry
The new geometry.
**Overrides:**
: Feature#setGeometry
- Feature#setGeometry
#### #
setProperties(values)
Sets a collection of key-value pairs. Note that this changes any existing properties and adds new ones (it does not remove any existing properties).
| Name | Type | Description |
| --- | --- | --- |
| values | Object. | Values. |
values
Values.
**Overrides:**
: Feature#setProperties
- Feature#setProperties
#### #
setStyle(styleopt)
Set the style for the feature to override the layer style. This can be a single style object, an array of styles, or a function that takes a resolution and returns an array of styles. To unset the feature style, call setStyle() without arguments or a falsey value.
setStyle()
| Name | Type | Attributes | Description |
| --- | --- | --- | --- |
| style | Style | | Style for this feature. |
style
Style for this feature.
**Overrides:**
: Feature#setStyle
- Feature#setStyle
#### #
toGeoJSON() -> {string}
Convert feature geometry to GeoJSON string with xy coordinates [long, lat]
**Overrides:**
: Feature#toGeoJSON
- Feature#toGeoJSON
#### #
toWKT() -> {string}
Convert feature geometry to WKT string with xy coordinates [long, lat]
**Overrides:**
: Feature#toWKT
- Feature#toWKT
# Events
#### #
FEATURE_CLICK
Event triggered when measure receives a click
| Name | Type | Description |
| --- | --- | --- |
| location | Location | Location with the coordinates for this event |
| measure | Measure | Measure clicked |
| layer | VectorLayer | Layer for this feature |
location
Location with the coordinates for this event
measure
Measure clicked
layer
Layer for this feature
**Overrides:**
: Feature#event:FEATURE_CLICK
- Feature#event:FEATURE_CLICK
#### #
FEATURE_HOVER
Event triggered when hovering over a measure
| Name | Type | Description |
| --- | --- | --- |
| location | Location | Location with the coordinates for this event |
| layer | VectorLayer | Layer for this feature |
| hover | boolean | If the feature it's hover or not.
False it's triggered when pointer not intersect when the geometry |
location
Location with the coordinates for this event
layer
Layer for this feature
hover
If the feature it's hover or not.
False it's triggered when pointer not intersect when the geometry
**Overrides:**
: Feature#event:FEATURE_HOVER
- Feature#event:FEATURE_HOVER
================================================================================
## 34. MeasurementManager
Class
# MeasurementManager
## MeasurementManager
The Measurement Manager class handles measurement logic. Use this class to change measurement units from feet to meters, enable tooltips, and activate/deactivate specific tools.
### Classes
**MeasurementManager**
# Methods
#### #
activate(tool)
Activates specified tool
| Name | Type | Description |
| --- | --- | --- |
| tool | MeasurementTools | tool to activate |
tool
tool to activate
**See:**
: MeasurementTools
- MeasurementTools
#### #
changeAreaUnits(unit)
Sets the area units to be shown by the tool.
| Name | Type | Description |
| --- | --- | --- |
| unit | AreaUnits | Imperial or metric value from AreaUnits |
unit
Imperial or metric value from AreaUnits
**See:**
: AreaUnits
- AreaUnits
#### #
changeLengthUnits(unit)
Sets the length units to be shown by the tool.
| Name | Type | Description |
| --- | --- | --- |
| unit | LengthUnits | Imperial or metric value from LengthUnits |
unit
Imperial or metric value from LengthUnits
**See:**
: LengthUnits
- LengthUnits
#### #
changeMeasureUnits(system)
Changes measurement system for tools. Changing measurement system will automatically choose the most appropriate measurement unit for each measurement.
| Name | Type | Description |
| --- | --- | --- |
| system | MeasureSystem | Imperial or metric value from MeasureSystem |
system
Imperial or metric value from MeasureSystem
**See:**
: MeasureSystem
- MeasureSystem
#### #
changeSlopeUnits(unit)
Sets the slope units to be shown by the tool.
| Name | Type | Description |
| --- | --- | --- |
| unit | SolpeUnits | Imperial or metric value from SlopeUnits |
unit
Imperial or metric value from SlopeUnits
**See:**
: SlopeUnits
- SlopeUnits
#### #
clear()
Clear all features
#### #
deactivate(tool)
Deactivates specified tool
| Name | Type | Description |
| --- | --- | --- |
| tool | MeasurementTools | tool to deactivate |
tool
tool to deactivate
**See:**
: MeasurementTools
- MeasurementTools
#### #
disableAreaTooltips()
Hides measurement area tooltips
#### #
disableLengthTooltips()
Hides measurement length tooltips
#### #
disableSlopeTooltips()
Hides measurement slope tooltips
#### #
disableTooltips()
Hides measurement tooltips
#### #
enableAreaTooltips()
Shows measurement area tooltips
#### #
enableLengthTooltips()
Shows measurement length tooltips
#### #
enableSlopeTooltips()
Shows measurement slope tooltips
#### #
enableTooltips()
Shows measurement tooltips
#### #
getDrawingLayer() -> {VectorLayer}
Returns the vector layer used for vector drawing.
Drawing layer
#### #
getMeasurementLayer() -> {GroupLayer}
Returns the vector layer used for make and save measurements.
Measurement Layer
#### #
toggleEdit()
Toggles Edit Mode for measurement tools
================================================================================
## 36. MultiPolygon
Class
# MultiPolygon
## MultiPolygon(polygons)
The MultiPolygon class allows you to group polygons and complete complex calculations over a larger area.
Learn more about how to implement the MultiPolygon class in our MultiPolygon tutorial
#### #
new MultiPolygon(polygons)
| Name | Type | Description |
| --- | --- | --- |
| polygons | Array.>> | Coordinates. |
polygons
Coordinates.
**Tutorials:**
: MultiPolygon
- MultiPolygon
Create simple MultiPolygon
const polygon = new Vexcel.Geometry.MultiPolygon([
[
[
new Vexcel.Geometry.Location(35.585851593232356, -116.136474609375),
new Vexcel.Geometry.Location(35.15584570226544, -117.39990234375),
new Vexcel.Geometry.Location(35.02999636902566, -115.631103515625),
new Vexcel.Geometry.Location(35.585851593232356, -116.136474609375),
]
],
[
[
new Vexcel.Geometry.Location(35.737595151747826, -115.224609375),
new Vexcel.Geometry.Location(35.08395557927643, -114.686279296875),
new Vexcel.Geometry.Location(35.746512259918504, -113.97216796875),
new Vexcel.Geometry.Location(35.737595151747826, -115.224609375),
],
],
]);
const polygon = new Vexcel.Geometry.MultiPolygon([
[
[
new Vexcel.Geometry.Location(35.585851593232356, -116.136474609375),
new Vexcel.Geometry.Location(35.15584570226544, -117.39990234375),
new Vexcel.Geometry.Location(35.02999636902566, -115.631103515625),
new Vexcel.Geometry.Location(35.585851593232356, -116.136474609375),
]
],
[
[
new Vexcel.Geometry.Location(35.737595151747826, -115.224609375),
new Vexcel.Geometry.Location(35.08395557927643, -114.686279296875),
new Vexcel.Geometry.Location(35.746512259918504, -113.97216796875),
new Vexcel.Geometry.Location(35.737595151747826, -115.224609375),
],
],
]);
### Classes
**MultiPolygon**
# Methods
#### #
clone() -> (non-null) {MultiPolygon}
Make a complete copy of the geometry.
Clone
#### #
getArea() -> {number}
Get the area of the multipolygon on projected plane.
Area (on projected plane).
#### #
getLocations() -> {Array.>>}
Return array of Location
array of Location object with latitude and longitude
#### #
getType() -> {object}
Get the type of this geometry.
Geometry type.
#### #
setLocations(polygons)
Update polygons
| Name | Type | Description |
| --- | --- | --- |
| polygons | Array.>> | Array of Array of array locations (rings) Location objects
Array of linear rings that define the polygon. The first linear ring of the
array defines the outer-boundary or surface of the polygon. Each subsequent
linear ring defines a hole in the surface of the polygon. A linear ring is
an array of vertices' coordinates where the first coordinate and the last are
equivalent. |
polygons
Array of Array of array locations (rings) Location objects
Array of linear rings that define the polygon. The first linear ring of the
array defines the outer-boundary or surface of the polygon. Each subsequent
linear ring defines a hole in the surface of the polygon. A linear ring is
an array of vertices' coordinates where the first coordinate and the last are
equivalent.
#### #
toGeoJSON() -> {string}
Convert geometry to GeoJSON string with xy coordinates [long, lat]
#### #
toWKT() -> {string}
Convert geometry to WKT string with xy coordinates [long, lat]
================================================================================
## 37. OSMLayer
Class
# OSMLayer
## OSMLayer(opts)
Layer for the OpenStreetMap tile server.
#### #
new OSMLayer(opts)
Initialization object
| Name | Type | Attributes | Default | Description |
| --- | --- | --- | --- | --- |
| opts | object | | | OSM layer options. |
| name | string | | | Layer name |
| order | number | | | The order for layer rendering. At rendering time, the layers will be ordered, first by order and then by position. When undefined, a order of 0 is assumed for layers that are added to the map's layers collection. |
| visible | boolean | | true | Visibility |
| opacity | number | | 1 | Opacity (0, 1). |
opts
OSM layer options.
name
Layer name
order
The order for layer rendering. At rendering time, the layers will be ordered, first by order and then by position. When undefined, a order of 0 is assumed for layers that are added to the map's layers collection.
visible
Visibility
opacity
Opacity (0, 1).
- LayerEvents#event:VISIBILITY_CHANGE
Create empty layer
const layer = new Vexcel.Layers.OSMLayer();
const layer = new Vexcel.Layers.OSMLayer();
### Extends
- BaseLayer
### Classes
**OSMLayer**
# Methods
#### #
getMaxZoom() -> {number}
Gets the maximum zoom level of the layer.
**Overrides:**
: BaseLayer#getMaxZoom
- BaseLayer#getMaxZoom
The maximum zoom level of the layer.
#### #
getMinZoom() -> {number}
Gets the minimum zoom level of the layer.
**Overrides:**
: BaseLayer#getMinZoom
- BaseLayer#getMinZoom
The minimum zoom level of the layer.
#### #
getOpacity() -> {number}
Gets the opacity of the layer (between 0 and 1).
**Overrides:**
: BaseLayer#getOpacity
- BaseLayer#getOpacity
The opacity of the layer.
#### #
getVisible() -> {boolean}
Gets the visibility of the layer (true or false).
true
false
**Overrides:**
: BaseLayer#getVisible
- BaseLayer#getVisible
The visibility of the layer.
#### #
setMaxZoom(maxZoom)
Sets the maximum zoom (exclusive) at which the layer is visible.
Note that the zoom levels for layer visibility are based on the
view zoom level, which may be different from a tile source zoom level.
| Name | Type | Description |
| --- | --- | --- |
| maxZoom | number | The maximum zoom of the layer. |
maxZoom
The maximum zoom of the layer.
**Overrides:**
: BaseLayer#setMaxZoom
- BaseLayer#setMaxZoom
#### #
setMinZoom(minZoom)
Sets the minimum zoom (inclusive) at which the layer is visible.
Note that the zoom levels for layer visibility are based on the
view zoom level, which may be different from a tile source zoom level.
| Name | Type | Description |
| --- | --- | --- |
| minZoom | number | The minimum zoom of the layer. |
minZoom
The minimum zoom of the layer.
**Overrides:**
: BaseLayer#setMinZoom
- BaseLayer#setMinZoom
#### #
setOpacity(opacity)
Sets the opacity of the layer, allowed values range from 0 to 1.
| Name | Type | Description |
| --- | --- | --- |
| opacity | number | The opacity of the layer. |
opacity
The opacity of the layer.
**Overrides:**
: BaseLayer#setOpacity
- BaseLayer#setOpacity
#### #
setVisible(visible)
Sets the visibility of the layer (true or false).
true
false
| Name | Type | Description |
| --- | --- | --- |
| visible | boolean | The visibility of the layer. |
visible
The visibility of the layer.
**Overrides:**
: BaseLayer#setVisible
- BaseLayer#setVisible
================================================================================
## 38. OverlayManager
Class
# OverlayManager
## OverlayManager
The Overlay Manager class provides interaction with the map's layers and allows you to add, remove, or find layers as needed.
### Classes
**OverlayManager**
# Methods
#### #
addLayer(layer)
Adds the given layer to the map. This layer will display on top of any existing layers.
| Name | Type | Description |
| --- | --- | --- |
| layer | BaseLayer | Layer to add |
layer
Layer to add
#### #
addLayers(layers)
Adds the given layers to the map. Added layers will display on top of any existing layers.
| Name | Type | Description |
| --- | --- | --- |
| layers | Array. | Array of layers to add |
layers
Array of layers to add
#### #
getDrawingLayer() -> {VectorLayer}
Returns the vector layer used for vector drawing.
Drawing layer
#### #
getLayerById(id) -> {BaseLayer}
Gets the layer with the same id as the specified in the 'id' parameter.
| Name | Type | Description |
| --- | --- | --- |
| id | number | The id of the layer to be returned. |
id
The id of the layer to be returned.
Layer
#### #
getLayers() -> {Array.}
Retrieves an array with all layers of the map.
Array of layers
#### #
getMarkerLayer() -> {VectorLayer}
Returns the vector layer used for showing markers
#### #
removeLayer(layer)
Removes the given layer from the map.
| Name | Type | Description |
| --- | --- | --- |
| layer | BaseLayer | Layer to remove |
layer
Layer to remove
#### #
removeLayers(layers)
Removes the given layers from the map.
| Name | Type | Description |
| --- | --- | --- |
| layers | Array. | Layers to remove |
layers
Layers to remove
================================================================================
## 39. Point
Class
# Point
## Point(location)
The Point class allows you to add points to your map.
Learn more about how to implement the Point class in our Point tutorial.
#### #
new Point(location)
| Name | Type | Description |
| --- | --- | --- |
| location | Location | Location object. |
location
Location object.
**Tutorials:**
: Point
- Point
Create simple point
const point = new Vexcel.Geometry.Point(
new Vexcel.Geometry.Location(33.34902669028525,-86.09930716682985)
);
const point = new Vexcel.Geometry.Point(
new Vexcel.Geometry.Location(33.34902669028525,-86.09930716682985)
);
### Classes
**Point**
# Methods
#### #
clone() -> (non-null) {Point}
Make a complete copy of the geometry.
Clone.
#### #
getLocation() -> {Location}
Return Location object
location object with latitude and longitude
#### #
getLocations() -> {Array.}
Return array of Location
array with location object with latitude and longitude
#### #
getType() -> {object}
Get the type of this geometry.
Geometry type.
#### #
setLocation(location)
Update location coordinates
| Name | Type | Description |
| --- | --- | --- |
| location | Location | Location object. |
location
Location object.
#### #
toGeoJSON() -> {string}
Convert geometry to GeoJSON string with xy coordinates [long, lat]
#### #
toWKT() -> {string}
Convert geometry to WKT string with xy coordinates [long, lat]
================================================================================
## 40. PointTool
Class
# PointTool
## PointTool
Measurement tool to draw points.
Learn more about our Point Tool in our 2D mode and 3D mode tutorials.
### Classes
**PointTool**
# Methods
#### #
activate()
This method activate the tool and you can start to draw a polygon
#### #
cancel()
This method cancel the current measure
#### #
changeTooltipsVisibility(visible)
Change visibility for measurement tooltips
| Name | Type | Description |
| --- | --- | --- |
| visible | boolean | boolean |
visible
boolean
#### #
clear()
This method clears all measurements of this tool.
#### #
deactivate()
This method deactivate the tool
#### #
disableEdit()
This method disable de edit mode for this tool
#### #
enableEdit()
This method enable de edit mode for this tool
================================================================================
## 41. Polygon
Class
# Polygon
## Polygon(rings)
The polygon class contains logic relating to polygons. A polygon is an area defined by a closed ring of locations. A simple polygon consists of an array of Location objects that form a boundary. This is useful for showing an area of interest on a map.
In some applications there may be a need to for more complex polygons, such as polygons that have a hole in them.
The first array of locations in a polygon represent the main border and is often called the exterior ring. All additional arrays of locations in a polygon are used to represent holes in the main polygon and are often called interior rings.
When creating a polygon at least one array of Location objects must be passed as an argument to the constructor. An array of Location arrays can be passed in when creating complex polygons. Learn more about how to implement polygons in our Polygon tutorial.
#### #
new Polygon(rings)
| Name | Type | Description |
| --- | --- | --- |
| rings | Array.> | Array of array locations (rings) Location objects
Array of linear rings that define the polygon. The first linear ring of the
array defines the outer-boundary or surface of the polygon. Each subsequent
linear ring defines a hole in the surface of the polygon. A linear ring is
an array of vertices' coordinates where the first coordinate and the last are
equivalent. |
rings
Array of array locations (rings) Location objects
Array of linear rings that define the polygon. The first linear ring of the
array defines the outer-boundary or surface of the polygon. Each subsequent
linear ring defines a hole in the surface of the polygon. A linear ring is
an array of vertices' coordinates where the first coordinate and the last are
equivalent.
**Tutorials:**
: Polygon
- Polygon
Create simple Polygon
const polygon = new Vexcel.Geometry.Polygon([
[
new Vexcel.Geometry.Location(32.36140331527543, -84.44091796875),
new Vexcel.Geometry.Location(32.36140331527543, -82.529296875),
new Vexcel.Geometry.Location(33.87041555094183, -82.529296875),
new Vexcel.Geometry.Location(33.87041555094183, -84.44091796875),
new Vexcel.Geometry.Location(32.36140331527543, -84.44091796875),
]
]);
const polygon = new Vexcel.Geometry.Polygon([
[
new Vexcel.Geometry.Location(32.36140331527543, -84.44091796875),
new Vexcel.Geometry.Location(32.36140331527543, -82.529296875),
new Vexcel.Geometry.Location(33.87041555094183, -82.529296875),
new Vexcel.Geometry.Location(33.87041555094183, -84.44091796875),
new Vexcel.Geometry.Location(32.36140331527543, -84.44091796875),
]
]);
### Classes
**Polygon**
# Methods
#### #
clone() -> (non-null) {Polygon}
Make a complete copy of the polygon.
Clone.
#### #
getArea() -> {number}
Return the area of the polygon on projected plane.
Area (on projected plane).
#### #
getLocations() -> {Array.>}
Return array of Location
array with location object with latitude and longitude
#### #
setLocations(rings)
Update polygon rings
| Name | Type | Description |
| --- | --- | --- |
| rings | Array.> | Array of array locations (rings) Location objects
Array of linear rings that define the polygon. The first linear ring of the
array defines the outer-boundary or surface of the polygon. Each subsequent
linear ring defines a hole in the surface of the polygon. A linear ring is
an array of vertices' coordinates where the first coordinate and the last are
equivalent. |
rings
Array of array locations (rings) Location objects
Array of linear rings that define the polygon. The first linear ring of the
array defines the outer-boundary or surface of the polygon. Each subsequent
linear ring defines a hole in the surface of the polygon. A linear ring is
an array of vertices' coordinates where the first coordinate and the last are
equivalent.
#### #
toGeoJSON() -> {string}
Convert geometry to GeoJSON string with xy coordinates [long, lat]
#### #
toWKT() -> {string}
Convert geometry to WKT string with xy coordinates [long, lat]
================================================================================
## 42. PolygonTool
Class
# PolygonTool
## PolygonTool
Measurement tool to draw polygons.
- Learn more about our Polygon Tool in our 2D mode and 3D mode tutorials.
### Classes
**PolygonTool**
# Methods
#### #
activate()
This method activate the tool and you can start to draw a polygon
#### #
cancel()
This method cancel the current measure
#### #
changeAreaUnits(unit)
Sets the area units to be shown by the tool.
| Name | Type | Description |
| --- | --- | --- |
| unit | AreaUnits | Imperial or metric value from AreaUnits AreaUnits |
unit
Imperial or metric value from AreaUnits AreaUnits
**See:**
: AreaUnits
- AreaUnits
#### #
changeLengthUnits(unit)
Sets the length units to be shown by the tool.
| Name | Type | Description |
| --- | --- | --- |
| unit | LengthUnits | Imperial or metric value from LengthUnits |
unit
Imperial or metric value from LengthUnits
**See:**
: LengthUnits
- LengthUnits
#### #
changeSlopeUnits(unit)
Sets the slope units to be shown by the tool.
| Name | Type | Description |
| --- | --- | --- |
| unit | SlopeUnits | Imperial or metric value from SlopeUnits |
unit
Imperial or metric value from SlopeUnits
**See:**
: SlopeUnits
- SlopeUnits
#### #
changeTooltipsVisibility(visible)
Change visibility for measurement tooltips
| Name | Type | Description |
| --- | --- | --- |
| visible | boolean | boolean |
visible
boolean
#### #
clear()
This method clears all measurements of this tool.
#### #
deactivate()
This method deactivate the tool
#### #
disableEdit()
This method disable de edit mode for this tool
#### #
enableEdit()
This method enable de edit mode for this tool
================================================================================
## 43. RectangleTool
Class
# RectangleTool
## RectangleTool
Measurement tool to draw Rectangles.
- Learn more about our Rectangle Tool in our 2D mode and 3D mode tutorials.
### Classes
**RectangleTool**
# Methods
#### #
activate()
This method activate the tool and you can start to draw a rectangle
#### #
cancel()
This method cancel the current measure
#### #
changeAreaUnits(unit)
Sets the area units to be shown by the tool.
| Name | Type | Description |
| --- | --- | --- |
| unit | AreaUnits | Imperial or metric value from AreaUnits AreaUnits |
unit
Imperial or metric value from AreaUnits AreaUnits
**See:**
: AreaUnits
- AreaUnits
#### #
changeLengthUnits(unit)
Sets the length units to be shown by the tool.
| Name | Type | Description |
| --- | --- | --- |
| unit | LengthUnits | Imperial or metric value from LengthUnits |
unit
Imperial or metric value from LengthUnits
**See:**
: LengthUnits
- LengthUnits
#### #
changeSlopeUnits(unit)
Sets the slope units to be shown by the tool.
| Name | Type | Description |
| --- | --- | --- |
| unit | SlopeUnits | Imperial or metric value from SlopeUnits |
unit
Imperial or metric value from SlopeUnits
**See:**
: SlopeUnits
- SlopeUnits
#### #
changeTooltipsVisibility(visible)
Change visibility for measurement tooltips
| Name | Type | Description |
| --- | --- | --- |
| visible | boolean | boolean |
visible
boolean
#### #
clear()
This method clears all measurements of this tool.
#### #
deactivate()
This method deactivate the tool
#### #
disableEdit()
This method disable de edit mode for this tool
#### #
enableEdit()
This method enable de edit mode for this tool
================================================================================
## 44. RegularShape
Class
# RegularShape
## RegularShape(opts)
Set regular shape style for vector features. The resulting shape will be a regular polygon when radius is provided, or a star when radius1 and radius2 are provided.
Learn more about implementing regular shape style in our Point shapes styles tutorial.
#### #
new RegularShape(opts)
Initialization object
| Name | Type | Attributes | Default | Description |
| --- | --- | --- | --- | --- |
| opts | object | | | Options |
| fill | Fill | | | Fill style. |
| points | number | | | Number of points for stars and regular polygons. In case of a polygon, the number of points
is the number of sides. |
| radius | number | | | Radius of a regular polygon. |
| radius1 | number | | | Outer radius of a star. |
| radius2 | number | | | Inner radius of a star. |
| angle | number | | 0 | Shape's angle in radians. A value of 0 will have one of the shape's point facing up. |
| displacement | Array. | | [0,0] | Displacement of the shape |
| stroke | stroke | | | Stroke style. |
| rotation | number | | 0 | Rotation in radians (positive rotation clockwise). |
| rotateWithView | boolean | | false | Whether to rotate the shape with the view. |
| scale | number | | 1 | Scale. Unless two dimensional scaling is required a better
result may be obtained with appropriate settings for radius, radius1 and radius2. |
opts
Options
fill
Fill style.
points
Number of points for stars and regular polygons. In case of a polygon, the number of points
is the number of sides.
radius
Radius of a regular polygon.
radius1
Outer radius of a star.
radius2
Inner radius of a star.
angle
Shape's angle in radians. A value of 0 will have one of the shape's point facing up.
displacement
Displacement of the shape
stroke
Stroke style.
rotation
Rotation in radians (positive rotation clockwise).
rotateWithView
Whether to rotate the shape with the view.
scale
Scale. Unless two dimensional scaling is required a better
result may be obtained with appropriate settings for radius, radius1 and radius2.
radius
radius1
radius2
**Tutorials:**
: Point shapes styles
- Point shapes styles
### Classes
**RegularShape**
# Methods
#### #
getAnchor() -> {Array.}
Get the anchor point in pixels. The anchor determines the center point for the
symbolizer.
Anchor.
#### #
getAngle() -> {number}
Get the angle used in generating the shape.
Shape's rotation in radians.
#### #
getDisplacement() -> {Array.}
Get the displacement of the shape
Shape's center displacement
#### #
getFill() -> {Fill}
Get the fill style for the shape.
Fill style.
#### #
getOpacity() -> {number}
Get the symbolizer opacity.
Opacity.
#### #
getPoints() -> {number}
Get the number of points for generating the shape.
Number of points for stars and regular polygons.
#### #
getRadius() -> {number}
Get the (primary) radius for the shape.
Radius.
#### #
getRadius2() -> {number|undefined}
Get the secondary radius for the shape.
Radius2.
#### #
getRotateWithView() -> {boolean}
Determine whether the symbolizer rotates with the map.
Rotate with map.
#### #
getRotation() -> {number}
Get the symoblizer rotation.
Rotation.
#### #
getScale() -> {number}
Get the symbolizer scale.
Scale.
#### #
getSize() -> {number}
Get the size of the symbolizer (in pixels).
Size.
#### #
getStroke() -> {Stroke}
Get the stroke style for the shape.
Stroke style.
#### #
setFill(fill)
Set the fill style.
| Name | Type | Description |
| --- | --- | --- |
| fill | Fill | |
fill
#### #
setOpacity(opacity)
Set the opacity.
| Name | Type | Description |
| --- | --- | --- |
| opacity | number | Opacity. |
opacity
Opacity.
#### #
setRotateWithView(rotateWithView)
Set whether to rotate the style with the view.
| Name | Type | Description |
| --- | --- | --- |
| rotateWithView | boolean | Rotate with map. |
rotateWithView
Rotate with map.
#### #
setRotation(rotation)
Set the rotation.
| Name | Type | Description |
| --- | --- | --- |
| rotation | number | Rotation. |
rotation
Rotation.
#### #
setScale(scale)
Set the scale.
| Name | Type | Description |
| --- | --- | --- |
| scale | number | Scale. |
scale
Scale.
================================================================================
## 45. RelativeHeightTool
Class
# RelativeHeightTool
## RelativeHeightTool
Measurement tool to draw height.
Learn more about our Relative Height Tool in our 3D mode tutorials.
### Classes
**RelativeHeightTool**
# Methods
#### #
activate()
This method activate the tool and you can start to draw a polygon
#### #
cancel()
This method cancel the current measure
#### #
changeTooltipsVisibility(visible)
Change visibility for measurement tooltips
| Name | Type | Description |
| --- | --- | --- |
| visible | boolean | boolean |
visible
boolean
#### #
clear()
This method clears all measurements of this tool.
#### #
deactivate()
This method deactivate the tool
================================================================================
## 47. Stroke
Class
# Stroke
## Stroke(opts)
Set stroke style for vector features. Note that the defaults given are the Canvas defaults, which will be used if option is not defined. The get functions return whatever was entered in the options; they will not return the default.
Learn more about implementing stroke styles in our Polygon styles, Point styles, Point shapes styles, Feature styles, and Text styles tutorials
#### #
new Stroke(opts)
Initialization object
| Name | Type | Attributes | Default | Description |
| --- | --- | --- | --- | --- |
| opts | object | | | Stroke layer options. |
| color | object | | null | A color definition "rgba(red, green, blue, alpha)", "rgb(red, green, blue)" and "#FFFFFF" format supported. |
| width | number | | | Width |
opts
Stroke layer options.
color
A color definition "rgba(red, green, blue, alpha)", "rgb(red, green, blue)" and "#FFFFFF" format supported.
width
Width
**Tutorials:**
: Polygon styles
Point styles
Point shapes styles
Feature styles
Text styles
- Polygon styles
- Point styles
- Point shapes styles
- Feature styles
- Text styles
### Classes
**Stroke**
# Methods
#### #
getColor() -> {string}
Get the stroke color.
A color definition "rgba(red, green, blue, alpha)", "rgb(red, green, blue)" and "#FFFFFF" format supported.
#### #
getWidth() -> {number}
Get the stroke width.
Width.
#### #
setColor(color)
Set the color.
| Name | Type | Description |
| --- | --- | --- |
| color | string | A color definition "rgba(red, green, blue, alpha)", "rgb(red, green, blue)" and "#FFFFFF" format supported. |
color
A color definition "rgba(red, green, blue, alpha)", "rgb(red, green, blue)" and "#FFFFFF" format supported.
#### #
setWidth(width)
Set the width.
| Name | Type | Description |
| --- | --- | --- |
| width | number | Width. |
width
Width.
================================================================================
## 48. Style
Class
# Style
## Style(opts)
Container for vector feature rendering styles. Any changes made to the style or its children through set*() methods will not take effect until the feature or layer that uses the style is re-rendered.
Learn more about implementing styles in our Polygon styles, Point styles, Point shapes styles, Feature styles, and Text styles tutorials.
#### #
new Style(opts)
Initialization object
| Name | Type | Attributes | Description |
| --- | --- | --- | --- |
| opts | object | | Tile layer options. |
| fill | Fill | | Fill style. |
| stroke | Stroke | | Stroke style |
| image | Image | | Image style |
| text | Text | | Text style |
opts
Tile layer options.
fill
Fill style.
stroke
Stroke style
image
Image style
text
Text style
**Tutorials:**
: Polygon styles
Point styles
Point shapes styles
Feature styles
Text styles
- Polygon styles
- Point styles
- Point shapes styles
- Feature styles
- Text styles
### Classes
**Style**
# Methods
#### #
getFill() -> {Fill}
Get the fill style.
#### #
getImage() -> {Image}
Get the image style
#### #
getStroke() -> {Stroke}
#### #
getText() -> {Text}
Get text style
#### #
setFill(fill)
Set the fill style.
| Name | Type | Description |
| --- | --- | --- |
| fill | Fill | |
fill
#### #
setImage(image)
Set the image style
| Name | Type | Description |
| --- | --- | --- |
| image | Image | |
image
#### #
setStroke(stroke)
Set the stroke style
| Name | Type | Description |
| --- | --- | --- |
| stroke | Stroke | |
stroke
#### #
setText(text)
Set text style
| Name | Type | Description |
| --- | --- | --- |
| text | Text | |
text
================================================================================
## 49. Swipe
Class
# Swipe
## Swipe(opts)
It is a control that adds a split screen to compare two map overlays.
Layers can be added to left (top) or right (bottom) side of the map. Layers that are not added are displayed on both sides
#### #
new Swipe(opts)
Constructor options
| Name | Type | Attributes | Description |
| --- | --- | --- | --- |
| opts | object | | Control options |
| layers | BaseLayer | | layer to swipe |
| rightLayer | ol.layer | | layer to swipe on right side |
| className | string | | control class name |
| position | number | | position propertie of the swipe [0,1], default 0.5 |
| orientation | string | | orientation properties (vertical|horizontal), default vertical |
opts
Control options
layers
layer to swipe
rightLayer
layer to swipe on right side
className
control class name
position
position propertie of the swipe [0,1], default 0.5
orientation
orientation properties (vertical|horizontal), default vertical
**Tutorials:**
: control-swipe
- control-swipe
### Classes
**Swipe**
================================================================================
## 50. Text
Class
# Text
## Text(opts)
Set text style for vector features.
Learn more about implementing text styles in our Feature styles and Text styles tutorials.
#### #
new Text(opts)
Initialization object
| Name | Type | Attributes | Default | Description |
| --- | --- | --- | --- | --- |
| opts | object | | | Options |
| font | string | | | Font style as CSS 'font' value, see:
https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/font. Default is '10px sans-serif' |
| maxAngle | number | | Math.PI/4 | When placement is set to 'line', allow a maximum angle between adjacent characters.
The expected value is in radians, and the default is 45° (Math.PI / 4). |
| offsetX | number | | 0 | Horizontal text offset in pixels. A positive will shift the text right. |
| offsetY | number | | 0 | Vertical text offset in pixels. A positive will shift the text down. |
| overflow | boolean | | false | For polygon labels or when placement is set to 'line', allow text to exceed
the width of the polygon at the label position or the length of the path that it follows. |
| placement | string | | 'point' | Text placement. |
| scale | number | | | Scale. |
| rotateWithView | boolean | | false | Whether to rotate the text with the view. |
| rotation | number | | 0 | Rotation in radians (positive rotation clockwise). |
| text | string | | | Text content. |
| textAlign | string | | | Text alignment. Possible values: 'left', 'right', 'center', 'end' or 'start'.
Default is 'center' for placement: 'point'. For placement: 'line', the default is to let the renderer choose a
placement where maxAngle is not exceeded. |
| textBaseline | string | | 'middle' | Text base line. Possible values: 'bottom', 'top', 'middle', 'alphabetic',
'hanging', 'ideographic'. |
| fill | Fill | | | Fill style. If none is provided, we'll use a dark fill-style (#333). |
| stroke | Stroke | | | Stroke style. |
| backgroundFill | Fill | | | Fill style for the text background when placement is
'point'. Default is no fill. |
| backgroundStroke | Stroke | | | Stroke style for the text background when placement
is 'point'. Default is no stroke. |
| padding | Array. | | [0, 0, 0, 0] | Padding in pixels around the text for decluttering and background. The order of
values in the array is [top, right, bottom, left]. |
opts
Options
font
Font style as CSS 'font' value, see:
https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/font. Default is '10px sans-serif'
maxAngle
When placement is set to 'line', allow a maximum angle between adjacent characters.
The expected value is in radians, and the default is 45° (Math.PI / 4).
placement
'line'
Math.PI / 4
offsetX
Horizontal text offset in pixels. A positive will shift the text right.
offsetY
Vertical text offset in pixels. A positive will shift the text down.
overflow
For polygon labels or when placement is set to 'line', allow text to exceed
the width of the polygon at the label position or the length of the path that it follows.
placement
'line'
placement
Text placement.
scale
Scale.
rotateWithView
Whether to rotate the text with the view.
rotation
Rotation in radians (positive rotation clockwise).
text
Text content.
textAlign
Text alignment. Possible values: 'left', 'right', 'center', 'end' or 'start'.
Default is 'center' for placement: 'point'. For placement: 'line', the default is to let the renderer choose a
placement where maxAngle is not exceeded.
placement: 'point'
placement: 'line'
maxAngle
textBaseline
Text base line. Possible values: 'bottom', 'top', 'middle', 'alphabetic',
'hanging', 'ideographic'.
fill
Fill style. If none is provided, we'll use a dark fill-style (#333).
stroke
Stroke style.
backgroundFill
Fill style for the text background when placement is
'point'. Default is no fill.
placement
'point'
backgroundStroke
Stroke style for the text background when placement
is 'point'. Default is no stroke.
placement
'point'
padding
Padding in pixels around the text for decluttering and background. The order of
values in the array is [top, right, bottom, left].
[top, right, bottom, left]
**Tutorials:**
: Feature styles
Text styles
- Feature styles
- Text styles
### Classes
**Text**
================================================================================
## 51. Toggle
Class
# Toggle
## Toggle(opts)
A simple toggle control. The control can be created with an interaction to control its activation.
#### #
new Toggle(opts)
Initialization object
| Name | Type | Attributes | Default | Description |
| --- | --- | --- | --- | --- |
| opts | object | | | Button options. |
| className | string | | | class of the control |
| title | number | | | title of the control |
| html | number | | | html to insert in the control |
| active | boolean | | false | the control is created active, default false |
| disable | boolean | | false | the control is created disabled, default false |
| bar | Bar | | | a subbar associated with the control (drawn when active if control is nested in a Bar) |
| onToggle | function | | | callback when control is clicked (or use change:active event) |
opts
Button options.
className
class of the control
title
title of the control
html
html to insert in the control
active
the control is created active, default false
disable
the control is created disabled, default false
bar
a subbar associated with the control (drawn when active if control is nested in a Bar)
onToggle
callback when control is clicked (or use change:active event)
**Tutorials:**
: Map Toggle
- Map Toggle
### Classes
**Toggle**
================================================================================
## 52. Transform
Class
# Transform
## Transform()
This class takes either lat/long/zoom or xyz coordinates and transforms the coordinates to the other type.
#### #
new Transform()
Transforms Lat/Long/Zoom coordinates to X/Y/Z coordinates or X/Y/Z to Lat/Long/Zoom
const transform = new Vexcel.Utils.Transform([34,-111,5]);
const transform = new Vexcel.Utils.Transform([34,-111,5]);
### Classes
**Transform**
# Methods
#### #
static
locationToTile(location, zoom) -> {Array.}
Transforms location to tile coordinates
| Name | Type | Description |
| --- | --- | --- |
| location | Location | Location object |
| zoom | number | zoom level for tile coordinate |
location
Location object
zoom
zoom level for tile coordinate
[x,y,z] tile coordinate
#### #
static
tileToLocation(z, x, y) -> {Location}
Convert tile coordinate to Location
| Name | Type | Description |
| --- | --- | --- |
| z | number | zoom level |
| x | number | x tile coordinate |
| y | number | x tile coordinate |
z
zoom level
x
x tile coordinate
y
x tile coordinate
================================================================================
## 53. UserService
Class
# UserService
## UserService()
Service to get info for users to initialize the map properly
Learn more about the User Service in our Init with username/password and start-maps tutorials.
#### #
new UserService()
### Classes
**UserService**
# Methods
#### #
getMaps(token, versionopt) -> {Array.}
Retrieves maps available for a user.
| Name | Type | Attributes | Default | Description |
| --- | --- | --- | --- | --- |
| token | string | | | The user's authentication token. |
| version | string
|
null | | null | The expected map version. If omitted, all maps are returned. Should be a value from MapVersion |
token
The user's authentication token.
version
The expected map version. If omitted, all maps are returned. Should be a value from MapVersion
- An array of map instances.
#### #
getUserInfo(username, password, mapVersionopt, applicationopt) -> {UserService~UserInfo}
Retrieves user information based on the provided credentials.
Additionally, it returns the list of maps associated with the user.
| Name | Type | Attributes | Default | Description |
| --- | --- | --- | --- | --- |
| username | string | | | The username of the user. |
| password | string | | | The user's password. |
| mapVersion | string
|
null | | null | The map version to request. If not specified, all maps are returned. Should be a value from MapVersion |
| application | string | | "map-control" | The application requesting access. |
username
The username of the user.
password
The user's password.
mapVersion
The map version to request. If not specified, all maps are returned. Should be a value from MapVersion
application
The application requesting access.
- The user information.
# Type Definitions
#### #
Map
Object with the map data received by the api
| Name | Type | Description |
| --- | --- | --- |
| id | string | identifier for map |
| name | string | name for the map |
| version | string | version for the map. Should be a value from MapVersion |
id
identifier for map
name
name for the map
version
version for the map. Should be a value from MapVersion
#### #
UserInfo
Object with the user data received by the api
| Name | Type | Description |
| --- | --- | --- |
| username | string | Triggered after the map is moved. |
| token | string | key to initialize and authorize this user |
| maps | Array. | list of maps allowed for this user |
username
Triggered after the map is moved.
token
key to initialize and authorize this user
maps
list of maps allowed for this user
================================================================================
## 54. VectorLayer
Class
# VectorLayer
## VectorLayer(opts)
Layer for Vector data that is rendered client-side.
Learn more about Vector Layers in our Vector Layer tutorial.
#### #
new VectorLayer(opts)
Initialization object
| Name | Type | Attributes | Default | Description |
| --- | --- | --- | --- | --- |
| opts | object | | | WFS layer options |
| name | string | | | Layer name |
| order | number | | | The order for layer rendering. At rendering time, the layers will be ordered,
first by order and then by position.
When undefined, a order of 0 is assumed for layers that are added to the map's layers collection. |
| visible | boolean | | true | Visibility |
| opacity | number | | 1 | Opacity (0, 1). |
| features | Array. | | | Feature list, the geometry of the features must be on geographic coordinates |
| style | Array.