Simulation

LM. Simulation

位置模拟器。

Constructor

new Simulation(options)

Description:
  • 构造方法。

Parameters:
Name Type Description
options object
Properties
Name Type Description
segments array.<object>

模拟数据。LM.Path#toSegments

speed number

速度,m/s。

interval number

更新位置的时间间隔,ms。

cost object

关键位置的停顿时间,ms。

Properties
Name Type Description
corner number

拐角。

access number

跨层。

Members

(readonly) speed :number

Description:
  • 速度。

速度。

Type:
  • number

Methods

pause()

Description:
  • 暂停。

resume()

Description:
  • 恢复。

setSpeed(speed)

Description:
  • 设置速度,m/s。

Parameters:
Name Type Description
speed number

simulate(callback, finish)

Description:
  • 模拟。

Parameters:
Name Type Description
callback function

模拟过程中的回调,返回模拟位置数据。LM.Simulation.Point

finish function

模拟结束的回调。

stop()

Description:
  • 停止。

Type Definitions

Point

Description:
  • 模拟位置数据。

Properties:
Name Type Description
position object

位置信息。

Properties
Name Type Description
x object

X坐标。

y object

Y坐标。

level object

楼层级别。

heading number

方向角。

模拟位置数据。

Type:
  • object