# along

Takes a LineString and returns a Point at a specified distance along the line.
接受一个LineString并返回沿该线指定距离的点。

参数

参数 类型 描述
line Feature <LineString> LineString
distance number 沿线距离
options Object 可选参数:见下文

options选项

属性 类型 默认值 描述
units string kilometers 可以是度、弧度、英里或公里

返回

Feature <Point> - Point distance units along the line

示例

var line = turf.lineString([
        [109.502991, 29.68718],
        [108.837829, 32.969237],
        [113.567871, 37.200787]
      ]);
var options = {units: 'miles'};

var along = turf.along(line, 300, options);

npm install @turf/along

Last Updated: 6/21/2023, 11:40:17 PM