Class: Popup

Popup

三维弹窗组件,用于三维点位弹窗展示相关信息

const popup = new Popup({
  content: "<div>测试企业弹窗</div><div>测试企业弹窗</div>",
  position: new Position(118.78600228, 31.9135434, 1.66113721),
  offset: [0, -32],
  className: "test-class"
});
this.$viewer.addWidget(popup);
// 弹窗关闭触发
popup.cancel = evt => {
  console.log(evt);
  return false;
};
widget/Popup.js, line 28
Name Type Description
options Object

弹窗可选属性

Name Type Default Description
position Position

弹窗位置

content Element | ElementString

弹窗内容,DOM对象或者DOM字符串

className String

弹窗样式名,可以用于覆盖原有弹窗样式

offset Array [0, -40] optional

xy 方向上的偏移

cancel function

弹窗关闭按钮关闭弹出时触发的回调

Extends

Classes

Popup

Members

enable

部件是否可用

id

部件唯一 id

state

部件当前状态

Methods

setContent(content)

widget/Popup.js, line 98

设置弹窗内容

Name Type Description
content *

DOM对象或字符串

inherited setPosition(position)

widget/Widget.js, line 134

设置部件位置

Name Type Description
position Position

部件位置