# new Polygon(rings)
Parameters:
Name | Type | Description |
---|---|---|
rings |
Array.<Array.<Location>>
|
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:
Example
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
Methods
# getArea() → {number}
Return the area of the polygon on projected plane.
Area (on projected plane).
number
# getLocations() → {Array.<Array.<Location>>}
Return array of Location
array with location object with latitude and longitude
Array.<Array.<Location>>
# setLocations(rings)
Update polygon rings
Parameters:
Name | Type | Description |
---|---|---|
rings |
Array.<Array.<Location>>
|
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. |