1. BosApi
1.1. new BosApi()
请求BOS后端服务的接口,详细内容请参考模型数据服务API
1.2. 方法
1.2.1. BosApi.getComponentsInfo(urlParams, requestParams, [token])
获取Geo模型构件信息。详见查询GEO模型构件信息接口
Returns : Promise
Kind : static method of BosApi
Notes : 后台请求地址:${site}/api/${databaseKey}/geomodels/components?key=
Param | Type | Default | Description |
---|---|---|---|
urlParams | Object |
请求地址参数 |
|
urlParams.site | String |
请求服务域名/IP地址 |
|
urlParams.databaseKey | String |
数据库key |
|
requestParams | Object |
请求地址参数 |
|
requestParams.key | String |
模型key,以'G-'开头的GeoModelKey |
|
[requestParams.share] | String |
分享key |
|
[requestParams.componentKey] | String |
构件key关键字 |
|
[requestParams.componentName] | String |
构件名称关键字 |
|
[requestParams.componentType] | String |
构件类型关键字 |
|
[requestParams.pageNumber] | String |
分页返回的页码,从0开始,后台默认为0 |
|
[requestParams.pageSize] | String |
分页返回每页最大条目,取值1~100,后台默认为10 |
|
[requestParams.attributes] | String |
返回属性列表,如不指定则返回全部 |
|
[token] | String |
'' |
BOS后台接口操作的通关令牌,默认为空,当GeoMap中的token属性有赋值时为GeoMap.token |
Example
var site = 'https://bos3d.bimwinner.com';
var databaseKey = 'e7466ee0834d4171920accea4c70fcb8';
var key = 'G1615364184515';
BOSGeo.BosApi.getComponentsInfo({site, databaseKey}, {key})
.then(res => {
console.log(res);
});
1.2.2. BosApi.getComponentsInfoMultiply(urlParams, requestParams, data, [token])
使用更多筛选条件获取Geo模型构件信息
Returns : Promise
Kind : static method of BosApi
Notes : 后台请求地址:${site}/api/${databaseKey}/geomodels/components?key=${key}&share={share}
Param | Type | Default | Description |
---|---|---|---|
urlParams | Object |
请求地址参数 |
|
urlParams.site | String |
请求服务域名/IP地址 |
|
urlParams.databaseKey | String |
数据库key |
|
requestParams | Object |
请求地址参数 |
|
requestParams.key | String |
模型key,以'G-'开头的GeoModelKey |
|
[requestParams.share] | String |
分享key |
|
[requestParams.pageNumber] | String |
分页返回的页码,从0开始,后台默认为0 |
|
[requestParams.pageSize] | String |
分页返回每页最大条目,取值1~100,后台默认为10 |
|
[requestParams.attributes] | String |
返回属性列表,如不指定则返回全部 |
|
data | Object |
请求体参数 |
|
[data.key] | String |
构件key关键字 |
|
[data.name] | String |
构件名称关键字 |
|
[data.type] | String |
构件类型关键字 |
|
[data.floor] | Object |
构件楼层筛选条件 |
|
[data.floor.operator] | String |
构件楼层筛选操作符关键字 |
|
[data.floor.value] | String |
构件楼层筛选楼层值关键字 |
|
[data.floor.logic] | String |
构件楼层筛选逻辑操作符关键字 |
|
[data.room] | Object |
构件房间筛选条件 |
|
[data.room.operator] | String |
构件房间筛选操作符关键字 |
|
[data.room.value] | String |
构件房间筛选房间值关键字 |
|
[data.room.logic] | String |
构件房间筛选逻辑操作符关键字 |
|
[token] | String |
'' |
BOS后台接口操作的通关令牌,默认为空,当GeoMap中的token属性有赋值时为GeoMap.token |
Example
var site = 'https://bos3d.bimwinner.com';
var databaseKey = 'e7466ee0834d4171920accea4c70fcb8';
var key = 'G1615364184515';
BOSGeo.BosApi.getComponentsInfoMultiply({site, databaseKey}, {key}, {})
.then(res => {
console.log(res);
});
1.2.3. BosApi.getModelInfo(urlParams, requestParams, [token])
获取Geo模型的基本信息。详见获取GEO模型信息接口
Returns : Promise
Kind : static method of BosApi
Notes : 后台请求地址:${site}/api/${databaseKey}/geomodels?key=
Param | Type | Default | Description |
---|---|---|---|
urlParams | Object |
请求地址参数 |
|
urlParams.site | Object |
请求服务域名/IP地址 |
|
urlParams.databaseKey | Object |
数据库key |
|
requestParams | Object |
请求地址参数 |
|
requestParams.key | String |
模型key,以'G-'开头的GeoModelKey |
|
[requestParams.share] | String |
分享key |
|
[token] | String |
'' |
BOS后台接口操作的通关令牌,默认为空,当GeoMap中的token属性有赋值时为GeoMap.token |
Example
var site = 'https://bos3d.bimwinner.com';
var databaseKey = 'e7466ee0834d4171920accea4c70fcb8';
var key = 'G1615364184515';
BOSGeo.BosApi.getModelInfo({site, databaseKey}, {key})
.then(res => {
console.log(res);
});
1.2.4. BosApi.getModelTreeList(urlParams, requestParams, [token]) ⇒ Promise
获取模型树列表。详见获取模型树列表接口
Returns : Promise
Kind : static method of BosApi
Notes : 后台请求地址:${site}/api/${databaseKey}/trees/list?modelKey={modelKey}&share={share}
Param | Type | Default | Description |
---|---|---|---|
urlParams | Object |
请求地址参数 |
|
urlParams.site | Object |
请求服务域名/IP地址 |
|
urlParams.databaseKey | Object |
数据库key |
|
requestParams | Object |
请求地址参数 |
|
requestParams.modelKey | String |
模型key,以'M-'开头的ModelKey |
|
[requestParams.share] | String |
分享key |
|
[token] | String |
'' |
BOS后台接口操作的通关令牌,默认为空,当GeoMap中的token属性有赋值时为GeoMap.token |
Example
var site = 'https://bos3d.bimwinner.com';
var databaseKey = 'e7466ee0834d4171920accea4c70fcb8';
var modelKey = 'M1615364184515';
BOSGeo.BosApi.getModelTreeList({site, databaseKey}, {modelKey})
.then(res => {
console.log(res);
});
1.2.5. BosApi.getTreeInfo(site, fileKey, [token])
获取模型树信息。
Returns : Promise
Kind : static method of BosApi
Notes : 后台请求地址:${site}/data?fileKey={fileKey}。
Param | Type | Default | Description |
---|---|---|---|
site | String |
请求服务域名/IP地址 |
|
fileKey | String |
模型树fileKey,可通过BosApi.getModelTreeList获取到 |
|
[token] | String |
'' |
BOS后台接口操作的通关令牌,默认为空,当GeoMap中的token属性有赋值时为GeoMap.token |
Example
BOSGeo.BosApi.getTreeInfo('https://bos3d.bimwinner.com', 'Z3JvdXAxMCxNNEUvMDIvMDQvckJBQkIyQV9OZUdBU0NVa0FBQUZHcWEtd01NMTM2Ny5neg==')
.then(res => {
console.log(res);
});
1.2.6. BosApi.getModelAttributes(options) ⇒ Promise
获取BIM模型所有构件的特定属性。 详见 BOS后端接口-查询GEO模型构件信息
Kind : static method of BosApi
Param | Type | Default | Description |
---|---|---|---|
options | Object |
模型信息 |
|
options.site | Object |
请求服务域名/IP地址 |
|
options.databaseKey | Object |
数据库Key |
|
options.geoModelKey | Object |
BOS解析模型后生成的G开头的geoModelKey |
|
options.attributeList | Array.<String> |
特定属性名称列表, 不建议查询一些不必要的属性 |
|
[options.pageSize] | Number |
1000 |
单次请求的构件最大数量(后台暂时不支持一次请求返回所有构件属性,所以需要多次请求),取值范围[100, 10000] |
[options.token] | Object |
BOS后端接口操作的通关令牌,默认为空,当GeoMap中的token属性有赋值时为GeoMap.token |
Example
BOSGeo.BosApi.getModelAttributes({
site: 'https://bos3d-alpha.bimwinner.com',
databaseKey: 'hed8e9803a8c4eb9845160e4d9c42155',
geoModelKey: 'G1635328717330',
attributeList: ['location']
}).then((res) => {
console.log('所有构件的包围盒信息: ', res);
});
1.2.7. BosApi.getModelFloors(options) ⇒ Promise
获取BIM模型空间树中的楼层信息 详见: 获取模型树列表接口
Kind : static method of BosApi
Kind : static method of BosApi
Param | Type | Description |
---|---|---|
options | Object |
模型信息 |
options.site | Object |
请求服务域名/IP地址 |
options.databaseKey | Object |
数据库Key |
options.modelKey | Object |
BOS解析模型后生成的M开头的modelKey |
[options.token] | Object |
BOS后端接口操作的通关令牌,默认为空,当GeoMap中的token属性有赋值时为GeoMap.token |
Example
BOSGeo.BosApi.getModelFloors(
{
site: 'https://bos3d-alpha.bimwinner.com',
databaseKey: 'hed8e9803a8c4eb9845160e4d9c42155',
// modelKey: 'M1628664337612', // 江湖别墅
modelKey: 'M1635158791394', // 办公室
}
).then((res) => {
console.log('楼层信息', res);
});