Constructor
new Walk(options, success, failed)
- Description:
构造方法。
Parameters:
| Name | Type | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
Properties
|
|||||||||
success |
function | 初始化成功回调,在回调方法触发后才能使用计算方法。 |
|||||||||
failed |
function | 初始化失败回调。 |
Methods
constraint(options) → {LM.Walk.ConstraintResult}
- Description:
路网约束,将位置点约束到路网上,返回约束结果。
Parameters:
| Name | Type | Description | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
Properties
|
Returns:
路网约束结果。
route(options) → {LM.Walk.RouteResult}
- Description:
路径计算。
Parameters:
| Name | Type | Description | |||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
Properties
|
Returns:
路径计算结果数据。
- Type
- LM.Walk.RouteResult
Type Definitions
ConstraintResult
- Description:
路网约束结果数据。
Properties:
| Name | Type | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
position |
object | 约束后的位置。 Properties
|
|||||||||||||||
distance |
number | 约束后的偏移距离。 |
|||||||||||||||
road |
object | 约束位置所在的道路信息。 Properties
|
路网约束结果数据。
Type:
- object
RouteResult
- Description:
路径计算结果数据。
Properties:
| Name | Type | Description |
|---|---|---|
error |
LM.RouteError | 错误信息。 |
path |
LM.Path | 路径。 |
路径计算结果数据。
Type:
- object