Constructor
new HtmlAnchorPlugin()
Methods
addLabel(options)
添加一个锚定标签
Parameters:
Name | Type | Description |
---|---|---|
options |
object | 参数对象 |
Example
参数说明
{
id:label ID
width: 内容框的width css,默认是'110px',
height:内容框的height css,默认是'25px',
bgColor:内容框的背景色,默认 'rgba(255,255,255,0.6)'
color: 主题色,影响锚点、锚线、内容框边框线的有绿色,默认 '#00a9ff'
html:内容dom的html文本,例如:'<label style="font-size:12px">锚定标记</label>',
position:锚点位置,默认:BIMI.THREE.Vector3(0,0,0)
vd: 锚线垂直方向:朝上/朝下 ,默认值:'top' ,可设置值为:'top'、'bottom'
hd: 锚线水平方向:左/中/右 默认值:'right' ,可设置值为: 'left'、'right'、'middle'
lineLength:锚线长度,默认值:100
distance:视距
}
dispose()
场景销毁
getLabel(id)
查询一个既有的锚定标签对象
Parameters:
Name | Type | Description |
---|---|---|
id |
* |
getLabelDom(id)
获得id对应的label dom对象,可以拿到dom后执行一些动态处理,譬如数据刷新
Parameters:
Name | Type | Description |
---|---|---|
id |
Number |
removeAll()
全部清除
removeLabel(id)
彻底移除某个Anchor
Parameters:
Name | Type | Description |
---|---|---|
id |
Number | 标签id |
setVisible(id, visible)
设置某个Anchor可见性
Parameters:
Name | Type | Description |
---|---|---|
id |
Number | 标签对象id |
visible |
Boolean | 可见性 |
updateContent(id, options)
修改既有Label的html和样式
Parameters:
Name | Type | Description |
---|---|---|
id |
* | |
options |
* |
Example
数据定义
{
width: 内容框的width css,不设就保持既有的
height:内容框的height css,不设就保持既有的
bgColor:内容框的背景色,不设就保持既有的
html:内容dom的html文本,不设就保持既有的
}
updatePosition(id, position)
修改既有Label的位置
Parameters:
Name | Type | Description |
---|---|---|
id |
* | lable id |
position |
* | 位置,BIMI.THREE.Vector3 |