Constructor
new HtmlIconLabelPlugin()
Methods
addLabel(option)
添加标签
Parameters:
Name | Type | Description |
---|---|---|
option |
* |
Example
参数定义
{
id: 标签ID 。
bindData: 业务绑定数据,可以在pick的时候返回 。
position: 位置。BIMI.THREE.Vector3
icon: 图标。icon-font css表达式,请确保icon-font文件已被引用
text:标签文字
color:icon的背景色
offset: 位置像素偏移量,默认[0,0] 。Array
distance:100 视距,默认是null,就无限制
}
getLabel(id)
获得某个Label对象
Parameters:
Name | Type | Description |
---|---|---|
id |
* | label id |
getLabelDom(id)
获得id对应的label dom对象,可以拿到dom后执行一些动态处理
Parameters:
Name | Type | Description |
---|---|---|
id |
Number |
onClick(event)
发送Label点击事件,可以通过plugin.on('click',data=>{})捕捉
Parameters:
Name | Type | Description |
---|---|---|
event |
* |
refresh()
刷新标签
removeAll()
清空所有label
removeLabel(id)
移除某个label
Parameters:
Name | Type | Description |
---|---|---|
id |
* | Label ID |
setClusterLimit(limit)
设置标签聚合的像素距离阀值
Parameters:
Name | Type | Default | Description |
---|---|---|---|
limit |
* | 100 |
setVisible(id, visible)
设置某个Label可见性
Parameters:
Name | Type | Description |
---|---|---|
id |
Number | 对象id |
visible |
Boolean | 可见性 |
updateContent(id, options)
修改既有Label的内容dom
Parameters:
Name | Type | Description |
---|---|---|
id |
* | lable id |
options |
* |
Example
数据定义
{
icon: icon-font图标
color:icon-font图标背景色
text:文字
}
updatePosition(id, position)
修改既有Label的位置
Parameters:
Name | Type | Description |
---|---|---|
id |
* | lable id |
position |
* | 位置,BIMI.THREE.Vector3 |