Appearance
KBE3D / KBCore / turf / lineString
函数: lineString()
lineString<
P>(coordinates:Position[],properties?:P,options?: {bbox?:BBox;id?:Id; }):Feature<LineString,P>
Function
Creates a LineString Feature from an Array of Positions.
类型参数
P
P extends GeoJsonProperties = GeoJsonProperties
参数
coordinates
Position[]
an array of Positions
properties?
P
an Object of key-value pairs to add as properties
options?
Optional Parameters
bbox?
Bounding Box Array [west, south, east, north] associated with the Feature
id?
Identifier associated with the Feature
返回
Feature<LineString, P>
LineString Feature
示例
ts
var linestring1 = turf.lineString([[-24, 63], [-23, 60], [-25, 65], [-20, 69]], {name: 'line 1'});
var linestring2 = turf.lineString([[-14, 43], [-13, 40], [-15, 45], [-10, 49]], {name: 'line 2'});
//=linestring1
//=linestring2