bim-components v0.1.0
bim-components
vue 中使用
安装
yarn add bim-components
或
npm i --save bim-components
main.js 导入
import 'bim-components/dist/bim-components.css'
import 'bim-components'
使用
<bim-engine ref="bimEngine"></bim-engine>
Props 参数
参数 | 说明 | 类型 | 默认值 |
---|---|---|---|
bimLayerList | 模型列表 | array | [] |
sceneType | 场景类型 0 地球场景 1 普通场景 | number | 0 |
locationOffset | 定位模型的旋转角度以及距离 | object | -- |
accessURL | 去水印服务地址 | string | -- |
isPick | 构件是否可选择 | boolean | false |
isOnlyCurrent | 构件是否单选 | boolean | false |
bimLayerList
{
// 模型列表 以数组的形式传递
name: 'longxing', //模型名称
url: '', //模型url
position: {
//模型放置位置{x:经度,y:纬度,z:高度}(选填默认{x:0.0,y:0.0,z:0.0})
x: 119.96739,
y: 30.139217,
z: 0,
},
rotation: {
//模型旋转角度{x:x轴旋转角度,y:y轴旋转角度,z:z轴旋转角度}(选填默认{x:0.0,y:0.0,z:0.0})
x: 0,
y: 0,
z: 0,
}
}
调用 api
this.$refs.bimEngine.api_name(Parmas)
API
beginMeasure(string MeasureType)
开启测量
BIM.MeasureType.length 长度测量
BIM.MeasureType.area 面积测量
BIM.MeasureType.angle 角度测量
BIM.MeasureType.entity 实体测量
clearMeasure()
清除测量
setPick( boolean isPick, boolean isOnlyCurrent )
设置模型是否可选
isPick 是否可选
isOnlyCurrent true 单选 false 点选
toggleSelected(boolean isAll , boolean isShow)
设置显示/隐藏选中模型
isAll 全部构件 / 选中构件
isShow 显示/隐藏
setHighlight(array guids)
设置构件高亮
guids 构件 id 数组
clearPick()
清除构件选中
clipPlane(string sectioningType, Number anchorType, Number planeType)
开启剖切
sectioningType: 剖切类型 slice 面剖切 side 体剖切
anchorType : 剖切锚点 0 上 1 下 2 左 3 右 4 中心
planeType:剖切方向 0 水平 1 垂直
addLabel(string type, object data,boolean clickEvent )
type: text 文字标签 imge 图片标签
clickEvent:图片标签是否需要点击事件(针对三维可视化问题打点项目)
文字标签参数 | 参数 | 说明 | 类型 | 默认值 | | -------------- | ------------------------------ | ------ | ------ | |text| 文字内容 | String | -- | |position| 标签位置,经度,纬度,高程或{x,y,z},未设置位置参数时标左键点击场景交互式添加 | Array -- | |fillColor | 字体颜色,符合 css 样式 color 属性的值 | String | #000 | | font| 字体样式,符合 css 样式 font 属性的值 | String | '14px sans-serif' |
图片标签参数 | 参数 | 说明 | 类型 | 默认值 | | -------------- | ------------------------------ | ------ | ------ | |image| 图片地址或 Image Dom 对象 | String | -- | |position| 标签位置,经度,纬度,高程或{x,y,z},未设置位置参数时标左键点击场景交互式添加 | Array -- | |width | 图片宽 | number | 50 | | height| 图片高度 | number | 50 | | nodeId | 图片标签所需绑定的构件id | String | -- |
clearLable()
清除标签
personStart(isCrash)
开始第一人称模式 (w 键前进、s 键后退、a 键左移、d 键右移、空格上移、b 键下移,↑ 向上转动、↓ 向下转动、← 向左转动、→ 向右转动!)
isCrash 是否开启碰撞
personStop()
结束第一人称模式
飞行相关
addFlyPath()
添加飞行路线
flyStartPlay()
开始播放
flyPausePlay()
暂停飞行
flyStopPlay()
停止飞行
flyMoveOn()
前进
flyMoveBack()
后退
screenPicture(number v)
屏幕截图
v 1 下载屏幕图片 2 获得截图 base64 位