English中文

ITwinData

将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
名称 Name 类型 Type 说明 Description
iTwinId string 要从中加载数据的 iTwin 的 id The id of the iTwin to load data from
realityDataId string 要加载的现实数据的id 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:
抛出: 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
名称 Name 类型 Type 说明 Description
iTwinId string 要从中加载数据的 iTwin 的 id The id of the iTwin to load data from
realityDataId string 要加载的现实数据的id 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
tilesetOptions Cesium3DTileset.ConstructorOptions 可选 optional 包含要传递给内部创建的选项的对象 Object containing options to pass to the internally created Cesium3DTileset.
返回: 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
名称 Name 类型 Type 说明 Description
iModelId string 要加载的 iModel 的 id The id of the iModel to load
tilesetOptions Cesium3DTileset.ConstructorOptions 可选 optional 包含要传递给内部创建的选项的对象 Object containing options to pass to the internally created Cesium3DTileset.
changesetId string 可选 optional 要加载的变更集的 ID,如果未提供,将使用最新的变更集 The id of the changeset to load, if not provided the latest changesets will be used
返回: 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
名称 Name 类型 Type 默认值 Default 说明 Description
iTwinId string 要从中加载数据的 iTwin 的 id The id of the iTwin to load data from
collectionId string 要加载的数据集合的id The id of the data collection to load
limit number 10000 可选 optional 每页的项目数必须介于 1 到 10,000 之间(含) number of items per page, must be between 1 and 10,000 inclusive
返回: Returns:
需要帮助吗?获得答案的最快方法是从社区和团队那里获得答案 Need help? The fastest way to get answers is from the community and team on the Cesium Forum.