Label

LM. Label

文字元素,通常为重要的文字信息,基础地图内容。

Members

(readonly) centroid :object

Description:
  • 中心点。

Properties:
Name Type Description
x number

X坐标。

y number

Y坐标。

z number

Z坐标。

中心点。

Type:
  • object

(readonly) classcode :number

Description:
  • 分类编码。

分类编码。

Type:
  • number

(readonly) cname :string

Description:
  • 中文名称。

中文名称。

Type:
  • string

(readonly) cname :string

Description:
  • 英文名称。

英文名称。

Type:
  • string

(readonly) code :string

Description:
  • 唯一编码。

唯一编码。

Type:
  • string

(readonly) type :LM.Type

Description:
  • 元素类型。

元素类型。

Type:

visible :boolean

Description:
  • 可见性。

可见性。

Type:
  • boolean

Methods

resetStyle()

Description:
  • 重置元素样式。

setSelected(selected)

Description:
  • 设置选中。

Parameters:
Name Type Description
selected boolean

true-选中 false-取消选中

setStyle(style)

Description:
  • 设置元素样式。

Parameters:
Name Type Description
style object
Properties
Name Type Description
text object

文字颜色。

Properties
Name Type Description
fill number

文字填充颜色,例如“rgba(255, 0, 0, 0.5)”。

stroke number

文字描边颜色,例如“rgba(0, 0, 255, 0.5)”。

plate object

背板颜色。

Properties
Name Type Description
fill number

背板填充颜色,例如“rgba(255, 255, 255, 0.5)”。

stroke number

背板描边颜色,例如“rgba(0, 0, 0, 0.5)”。

opacity string

文字不透明度,0~1.0。文字部分的透明度text.opacity * opacity,背板透明度plate.opacity * opacity。

setVisible(visible)

Description:
  • 设置可见性。

Parameters:
Name Type Description
visible boolean

true-显示 false-隐藏