CustomItemConfig

类:自定义标签配置项

Constructor

new Glodon.Bimface.Plugins.Drawable.CustomItemConfig()

构造自定义标签配置项

Members

NameTypeDescription
angleNumber

外部标签的旋转角度

contentString

自定义标签的内容,可以是文本DOM元素

draggableBoolean

是否开启拖拽

enableDepthTestBoolean

是否开启深度检测,开启后可监听标签的遮挡状态变化事件,默认为false。适用于Viewer3D、ViewerGIS。

heightNumber

自定义标签的高度,单位px

idString

外部标签ID

layerIdString

图层ID,仅在ViewerGIS下生效

modelIdString

模型ID,仅在Viewer3D下生效

objectIdString

绑定的构件ID

offsetXNumber

自定义标签沿X轴的偏移量,单位px

offsetYNumber

自定义标签沿Y轴的偏移量,单位px

opacityNumber

自定义标签的不透明度,范围0-1,默认为0.75

tooltipString

标签的提示内容

tooltipStyleObject

标签的提示样式

visibleDistanceNumber

可见距离,单位同场景单位,当相机与标签的距离小于可见距离时才会显示标签,默认为空,即不限制距离,适用于Viewer3D、ViewerGIS。

widthNumber

自定义标签的宽度,单位px

worldPositionGlodon.Web.Geometry.Point3d

外部标签坐标,图纸中{x:,y:},模型中{x:,y:,z}

Example

自定义标签dom配置示例

// 创建自定义元素,可以是一个dom element,也可以是个字符串  
let config = new Glodon.Bimface.Plugins.Drawable.CustomItemConfig();
let content = document.createElement("div");
content.innerHTML =
 '<div class="leadTips"><div style="width:49px;height:35px;"><img src="https://static.bimface.com/attach/24ce9654e88a4218908f46279e5c4b04_line.png" height="35" width="49"/></div><div class="leadText" id="canvasDiv"></div></div>';
config.content = content;