Path

LM. Path

导航路线。

Members

(readonly) distance :number

Description:
  • 距离。

距离。

Type:
  • number

(readonly) steps :array.<LM.Path.Step>

Description:
  • 路线详细步骤数组。

路线详细步骤数组。

Type:

(readonly) type :LM.PathType

Description:
  • 类型。

类型。

Type:

Methods

constraint(options) → {LM.Path.ConstraintResult}

Description:
  • 路线约束,将位置点约束到路线上,返回约束结果。

Parameters:
Name Type Description
options object
Properties
Name Type Description
position object

位置。

Properties
Name Type Description
x object

X坐标。

y object

Y坐标。

level object

楼层级别。

Returns:

约束结果。

Type
LM.Path.ConstraintResult

toSegments() → {array.<object>}

Description:
  • 将路线转换为绘制线标注的数据结构。LM.Line

Returns:
Type
array.<object>

Type Definitions

ConstraintResult

Description:
  • 路线约束结果数据。

Properties:
Name Type Description
position object

约束后的位置。

Properties
Name Type Description
x object

X坐标。

y object

Y坐标。

level object

楼层级别。

distance number

约束后的偏移距离。

step LM.Path.Step

约束位置所在的步骤。

passed number

经过的路程,距离起点的路线上距离。

路线约束结果数据。

Type:
  • object

Step

Description:
  • 导航步骤。

Properties:
Name Type Description
bearing object

方位。

Properties
Name Type Description
cn string

中文,包含:直行、向右前方转弯、右转、向右后方转弯、掉头、向左后方转弯、左转、向左前方转弯、向上、向下。

en string

英文。包含:straight、turn diagonally to the right、turn right、turn diagonally to the right rear、turn around、turn diagonally to the left rear、turn left、turn diagonally to the left、up to、down to。

sentence object

导航短语。

Properties
Name Type Description
cn string

中文。

en string

英文。

floors array.<object>

楼层信息,数组长度等于1时是同层步骤,大于1是跨层步骤。

floors[].level number

楼层级别。

floors[].cname string

中文名称。

floors[].ename string

英文名称。

heading number

方向角,同层有效。

direction object

方向,同层有效。

Properties
Name Type Description
cn string

中文,包含:北、东北、东、东南、南、西南、西、西北。

en string

英文,包含:north、northeast、east、southeast、south、southwest、west、northwest。

road object

道路信息,同层有效。

Properties
Name Type Description
classification LM.Classification

分类。

cname string

中文名称。

ename string

英文名称。

distance number

距离,同层有效。

accessMode LM.AccessMode

通行方式,跨层有效。

facility object

设施信息,跨层有效。

Properties
Name Type Description
cname string

中文名称。

ename string

英文名称。

points array.<object>

路线节点坐标数组,当floors大于1时,与floors中的元素一一对应。

points[].x array.<object>

X坐标。

points[].y array.<object>

Y坐标。

导航步骤。

Type:
  • object