Methods for loading iTwin platform data into CesiumJS
Experimental
This feature is not final and is subject to change without Cesium's standard deprecation policy.
参考:
方法
static Cesium.ITwinData.createTilesetForRealityDataId(iTwinId, realityDataId, type, rootDocument) → Promise.<Cesium3DTileset>
Create a tileset for the specified reality data id. This function only works
with 3D Tiles meshes and point clouds.
If the
type
or rootDocument
are not provided this function
will first request the full metadata for the specified reality data to fill these values.
参数名称 | 类型 | 描述信息 |
---|---|---|
iTwinId |
string | The id of the iTwin to load data from |
realityDataId |
string | The id of the reality data to load |
type |
ITwinPlatform.RealityDataType | 可选 The type of this reality data |
rootDocument |
string | 可选 The path of the root document for this reality data |
返回值:
Experimental
This feature is not final and is subject to change without Cesium's standard deprecation policy.
static Cesium.ITwinData.createTilesetFromIModelId(iModelId, options) → Promise.<(Cesium3DTileset|undefined)>
Create a
Cesium3DTileset
for the given iModel id using iTwin's Mesh Export API.
If there is not a completed export available for the given iModel id, the returned promise will resolve to undefined
.
We recommend waiting 10-20 seconds and trying to load the tileset again.
If all exports are Invalid this will throw an error.
参数名称 | 类型 | 描述信息 |
---|---|---|
iModelId |
string | The id of the iModel to load |
options |
Cesium3DTileset.ConstructorOptions |
可选
Object containing options to pass to the internally created Cesium3DTileset . |
返回值:
A promise that will resolve to the created 3D tileset or
undefined
if there is no completed export for the given iModel id
Throws:
-
RuntimeError : If all exports for the given iModel are Invalid
-
RuntimeError : If the iTwin API request is not successful
使用示例:
const tileset = await Cesium.ITwinData.createTilesetFromIModelId(iModelId);
if (Cesium.defined(tileset)) {
viewer.scene.primitives.add(tileset);
}
Experimental
This feature is not final and is subject to change without Cesium's standard deprecation policy.