Class: BillboardPlugin

BillboardPlugin()

广告牌插件

Constructor

new BillboardPlugin()

Methods

addLabel(options)

创建Billboard标签
Parameters:
Name Type Description
options object
Example
参数结构:
{
     id:Number 标签ID
     dom:dom对象或者是html文本 
     position:位置,默认BIMI.THREE.Vector3(0,0,0);
     scale:整体缩放,默认0.1,这个数据尽量小一点,清晰。
     rotate:旋转,默认BIMI.THREE.Vector3(0,0,0);
     bindData:object 业务绑定数据 
     distance:Number 视距 
}

createBillboard1(title, text, footer, width, height)

使用默认样式1创建bilboard Dom
Parameters:
Name Type Default Description
title * 标题
text * 内容
footer * 页脚
width * 120px billboard宽度 默认120px
height * 120px billboard高度 默认120px

createBillboard2(title, text, width, height)

使用默认样式2创建bilboard Dom
Parameters:
Name Type Default Description
title * 标题
text * 内容
width * 120px billboard宽度 默认120px
height * 60px billboard高度 默认60px

getLabel(id)

获得标签
Parameters:
Name Type Description
id *

getLabelDom(id)

获得标签Dom,可以直接对dom进行操作
Parameters:
Name Type Description
id *

removeAll()

清除所有标签

removeLabel(id)

移除标签
Parameters:
Name Type Description
id *

setVisible(id, visible)

设置某个billboard可见性
Parameters:
Name Type Description
id Number 对象id
visible Boolean 可见性

updatePosition(id, position, rotate)

修改既有Label的位置
Parameters:
Name Type Description
id * 标签ID
position * 位置,BIMI.THREE.Vector3
rotate * 旋转,BIMI.THREE.Vector3