将iTwin平台数据加载到CesiumJS中的方法 Methods for loading iTwin platform data into CesiumJS
实验性 Experimental
此功能不是最终版本,可能会在没有 Cesium 标准弃用政策的情况下进行更改。 This feature is not final and is subject to change without Cesium's standard deprecation policy.
另见: See:
方法 Methods
static Cesium.ITwinData.createDataSourceForRealityDataId(options) → Promise.<(GeoJsonDataSource|KmlDataSource)>
为指定的现实数据 ID 创建正确类型的数据源。此函数仅适用于 KML 和 GeoJSON 类型数据。如果 Create a data source of the correct type for the specified reality data id. This function only works for KML and GeoJSON type data. 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 | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
|
返回: Returns:
抛出: Throws:
-
RuntimeError :如果该函数不支持现实数据类型 : if the type of reality data is not supported by this function
static Cesium.ITwinData.createTilesetForRealityDataId(options) → Promise.<Cesium3DTileset>
为指定的现实数据 ID 创建一个图块集。此功能仅适用于 3D Tiles 网格和点云。如果 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. The maximumScreenSpaceError 生成的图块集的数量将默认为 4,除非它被给定的图块集选项显式覆盖。 of the resulting tileset will default to 4, unless it is explicitly overridden with the given tileset options.
| 名称 Name | 类型 Type | 说明 Description | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
|
返回: Returns:
抛出: Throws:
-
RuntimeError :如果该函数不支持现实数据类型 : if the type of reality data is not supported by this function
实验性 Experimental
此功能不是最终版本,可能会在没有 Cesium 标准弃用政策的情况下进行更改。 This feature is not final and is subject to change without Cesium's standard deprecation policy.
static Cesium.ITwinData.createTilesetFromIModelId(options) → Promise.<(Cesium3DTileset|undefined)>
创建一个 Create a
Cesium3DTileset 使用 iTwin 的网格导出 API 获取给定的 iModel id。如果给定的 iModel id 没有可用的完整导出,则返回的承诺将解析为 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。我们建议等待 10-20 秒,然后尝试再次加载图块集。如果所有导出均无效,则会引发错误。请参阅 . We recommend waiting 10-20 seconds and trying to load the tileset again. If all exports are Invalid this will throw an error. See the iTwin Platform Mesh Export API documentation 有关请求参数的更多信息 for more information on request parameters
| 名称 Name | 类型 Type | 说明 Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
|
返回: Returns:
一个承诺,将解决创建的 3D Tiles集或 A promise that will resolve to the created 3D tileset or
undefined 如果给定的 iModel id 没有完成导出 if there is no completed export for the given iModel id
抛出: Throws:
-
RuntimeError :如果给定 iModel 的所有导出均无效 : If all exports for the given iModel are Invalid
-
RuntimeError :如果 iTwin API 请求不成功 : 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
此功能不是最终版本,可能会在没有 Cesium 标准弃用政策的情况下进行更改。 This feature is not final and is subject to change without Cesium's standard deprecation policy.
static Cesium.ITwinData.loadGeospatialFeatures(options) → Promise.<GeoJsonDataSource>
从地理空间要素 API 将数据加载为 GeoJSON。 Load data from the Geospatial Features API as GeoJSON.
| 名称 Name | 类型 Type | 说明 Description | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
|
