Line

LM. Line

线标注,覆盖物的一种。

Constructor

new Line(options)

Description:
  • 构造方法。

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

位置。

Properties
Name Type Description
levels array.<number>

楼层级别数组。与points数量相同。当points楼层相同,只需要设置[0]。

points array.<object>

点集合。

Properties
Name Type Description
x number

X坐标。

y number

Y坐标。

z number

Z坐标。

smooth boolean

平滑处理,设置为true时插值平滑。

style object

样式。

Properties
Name Type Description
color string

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

width number

线宽,未设置为1.0。

border object

描边,需要时设置。

Properties
Name Type Description
color string

描边颜色。

width number

描边宽度。

arrow object

箭头,需要时设置。

Properties
Name Type Description
color string

箭头颜色。

width number

箭头宽度。

gap number

箭头间隔,影响稀疏程度。

Members

(readonly) type :LM.Type

Description:
  • 元素类型。

元素类型。

Type:

(readonly) visible

Description:
  • 可见性。

可见性。

Methods

addTo(map)

Description:
  • 添加。

Parameters:
Name Type Description
map LM.Map

地图。

remove()

Description:
  • 移除。

setVisible(visible)

Description:
  • 设置可见性。

Parameters:
Name Type Description
visible boolean

true-显示 false-隐藏。