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