Class: Tooltip

Tooltip

提示框

const tooltip = new ToolTip()
viewer.addWidget(tooltip)
tooltip.showAt(new Position(117.95166139, 38.01728123, 0),"<div>测试弹窗</div><div>测试弹窗</div>")
viewer.on(QEarth.Event.MouseEventType.MOUSE_MOVE, e => {
  tooltip.setPosition(position).setContent("我是鼠标提示");
});

new Tooltip()

widget/Tooltip.js, line 21

Extends

Classes

Tooltip

Members

enable

部件是否可用

id

部件唯一 id

state

部件当前状态

Methods

inherited setContent(content)

widget/Widget.js, line 151

设置内容

Name Type Description
content Element | ElementString

内容

inherited setPosition(position)

widget/Widget.js, line 134

设置部件位置

Name Type Description
position Position

部件位置

showAt(position, content)

widget/Tooltip.js, line 51

设置提示框位置以及内容

Name Type Description
position Position

位置坐标

content Element | ElementString

内容