Class: SpritePicturePlugin

SpritePicturePlugin()

三维图片标签

Constructor

new SpritePicturePlugin()

Methods

addLabel(options)

创建三维图片标签,为了保证图片的清晰度,建议图片原始尺寸是指定width和height的2倍,譬如想显示为32*32的标签,图片的原始尺寸为64*64
Parameters:
Name Type Description
options Object
Example
参数结构:
{
     id:Number 对象的ID,可以通过该ID来查询、删除标签 
     url: string 图片url 
     position:位置 BIMI.THREE.Vector3 
     zoom:true/false 是否跟随视距缩放 默认false 
     bindData:object 业务绑定数据,可以在pick的时候返回 
     width:Number 标签宽度,如果不设置,采用图片本身宽度,建议设置为图片宽度的1/2,清晰。
     height:Number 标签高度,如果不设置,采用图片本身高度,建议设置为图片高度的1/2,清晰。
     distance:Number 视距 
}

getLabel(id)

获得标签对象,返回的是THREE.Sprite
Parameters:
Name Type Description
id * label id

removeAll()

全部清除

removeLabel(id)

移除标签
Parameters:
Name Type Description
id *

setVisible(id, visible)

可见性
Parameters:
Name Type Description
id *
visible *

updateContent(id, options)

修改既有Label的内容dom
Parameters:
Name Type Description
id *
options *
Example
参数结构:
{
     url:图片url
     width:指定标签的width,如果不设置,默认就使用图片的宽度,建议width是图片宽度的1/2,清晰度高。
     height: 指定标签的height,如果不设置,默认就使用图片的高度,建议width是图片高度的1/2,清晰度高。
}

updatePosition(id, position)

修改既有Label的位置
Parameters:
Name Type Description
id * lable id
position * 位置,BIMI.THREE.Vector3