# new MultiLine(locations)
Create a new MultiLine geometry.
Parameters:
Name | Type | Description |
---|---|---|
locations |
Array.<Array.<Location>> | Array of arrays of Location objects. |
- Tutorials:
-
- Tutorial: geometries-multiline
If no locations are provided.
Example
Create a simple MultiLine
const line = new Vexcel.Geometry.MultiLine([
[
new Vexcel.Geometry.Location(30.770159115784214, -86.6162109375),
new Vexcel.Geometry.Location(31.914867503276223, -88.57177734375),
new Vexcel.Geometry.Location(33.50475906922609, -87.2094726562),
],
[
new Vexcel.Geometry.Location(40.40478114596104, -104.98070585728213),
new Vexcel.Geometry.Location(40.404746239340966, -104.98102257159059),
]
]);
Classes
Methods
# clone() → (non-null) {MultiLine}
Create a deep copy of this MultiLine geometry.
A cloned MultiLine instance.
# getLength() → {number}
Get the total length of the polyline on the projected plane.
Length in map units.
# getLocations() → {Array.<Array.<Location>>}
Get the locations that define the polyline.
Array of arrays of Location objects with latitude and longitude.
# setLocations(lines)
Update the polyline with new locations.
Parameters:
Name | Type | Description |
---|---|---|
lines |
Array.<Array.<Location>> | Array of arrays of Location objects. |
# toGeoJSON() → {string}
Convert geometry to GeoJSON string with xy coordinates [long, lat].
GeoJSON representation.
# toWKT() → {string}
Convert geometry to WKT string with xy coordinates [long, lat].
WKT representation.