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.
See:
Methods
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.
Name | Type | Description |
---|---|---|
iTwinId |
string | The id of the iTwin to load data from |
realityDataId |
string | The id of the reality data to load |
type |
ITwinPlatform.RealityDataType | optional The type of this reality data |
rootDocument |
string | optional The path of the root document for this reality data |
Returns:
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.
Name | Type | Description |
---|---|---|
iModelId |
string | The id of the iModel to load |
options |
Cesium3DTileset.ConstructorOptions |
optional
Object containing options to pass to the internally created Cesium3DTileset . |
Returns:
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
Example:
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.