Location

LM. Location

定位标注,覆盖物的一种。

Constructor

new Location(options)

Description:
  • 构造方法。

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

位置。

Properties
Name Type Description
level number

楼层级别。

x number

X坐标。

y number

Y坐标。

z number

Z坐标。

style object

样式。

Properties
Name Type Description
color string

颜色,未设置为'#FFFFFF'。

opacity number

不透明度,未设置为1.0。

url string

图片资源。

size number

图片大小。

Members

(readonly) type :LM.Type

Description:
  • 元素类型。

元素类型。

Type:

(readonly) visible

Description:
  • 可见性。

可见性。

Methods

addTo(map)

Description:
  • 添加。

Parameters:
Name Type Description
map LM.Map

地图。

moveTo(options)

Description:
  • 移动。

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

目标位置。

Properties
Name Type Description
level number

目标位置楼层级别。

x number

目标位置X坐标。

y number

目标位置Y坐标。

z number

目标位置Z坐标。

animation object

动画参数,未设置时无动画效果。

Properties
Name Type Description
duration number

动画持续时间ms。

times number

动画次数,未设置为1。

interval number

动画间隔ms,次数大于1时生效。

interpolation LM.Interpolation

插值方式,未设置为LINEAR。

callback function

动画执行过程中的回调方法,返回与options.position相同结构的数据内容。

finish function

动画执行完成回调方法。

remove()

Description:
  • 移除。

rotateTo(options)

Description:
  • 旋转。

Parameters:
Name Type Description
options object
Properties
Name Type Description
heading number

方位角度。

animation object

动画参数,未设置时无动画效果。

Properties
Name Type Description
duration number

动画持续时间ms。

times number

动画次数,未设置为1。

interval number

动画间隔ms,次数大于1时生效。

interpolation LM.Interpolation

插值方式,未设置为LINEAR。

callback function

动画执行过程中的回调方法,返回方位角度。

finish function

动画执行完成回调方法。

setStyle(style)

Description:
  • 设置样式。

Parameters:
Name Type Description
style object

样式。

Properties
Name Type Description
color string

颜色,未设置为'#FFFFFF'。

opacity number

不透明度,未设置为1.0。

url string

图片资源。

size number

图片大小。

setVisible(visible)

Description:
  • 设置可见性。

Parameters:
Name Type Description
visible boolean

true-显示 false-隐藏。