I3SDataProvider 是 I3S 支持的主要公共类。 url 选项应该返回一个场景对象。当前支持的 I3S 版本为 1.6 和 1.7/1.8 (OGC I3S 1.2)。 I3SFeature 和 I3SNode 类通过公共接口实现 I3S 实体的对象模型。 An I3SDataProvider is the main public class for I3S support. The url option should return a scene object. Currently supported I3S versions are 1.6 and 1.7/1.8 (OGC I3S 1.2). I3SFeature and I3SNode classes implement the Object Model for I3S entities, with public interfaces.
该对象通常不直接实例化,使用 This object is normally not instantiated directly, use
I3SDataProvider.fromUrl.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
options |
I3SDataProvider.ConstructorOptions | 描述初始化选项的对象 An object describing initialization options |
示例: Examples:
try {
const i3sData = await I3SDataProvider.fromUrl(
"https://tiles.arcgis.com/tiles/z2tnIkrLQ2BRzr6P/arcgis/rest/services/Frankfurt2017_vi3s_18/SceneServer/layers/0"
);
viewer.scene.primitives.add(i3sData);
} catch (error) {
console.log(`There was an error creating the I3S Data Provider: ${error}`);
}
try {
const geoidService = await Cesium.ArcGISTiledElevationTerrainProvider.fromUrl(
"https://tiles.arcgis.com/tiles/z2tnIkrLQ2BRzr6P/arcgis/rest/services/EGM2008/ImageServer"
);
const i3sData = await I3SDataProvider.fromUrl(
"https://tiles.arcgis.com/tiles/z2tnIkrLQ2BRzr6P/arcgis/rest/services/Frankfurt2017_vi3s_18/SceneServer/layers/0", {
geoidTiledTerrainProvider: geoidService
});
viewer.scene.primitives.add(i3sData);
} catch (error) {
console.log(`There was an error creating the I3S Data Provider: ${error}`);
}
另见: See:
成员 Members
确定是否根据颜色顶点属性调整材质的 Alpha 模式。 Determines if the alpha mode of the material will be adjusted depending on the color vertex attribute.
确定是否将解析 I3S 符号系统并将其应用于图层。 Determines if the I3S symbology will be parsed and applied for the layers.
确定是否为没有法线的 I3S 几何体生成平坦法线。 Determines if the flat normals will be generated for I3S geometry without normals.
获取此对象的 I3S 数据。 Gets the I3S data for this object.
readonly extent : Rectangle
获取此 I3S 覆盖的范围。 Gets the extent covered by this I3S.
readonly geoidTiledTerrainProvider : ArcGISTiledElevationTerrainProvider
地形提供程序引用 GEOID 服务以用于正交到椭球体的转换。 The terrain provider referencing the GEOID service to be used for orthometric to ellipsoidal conversion.
readonly layers : Array.<I3SLayer>
获取图层的集合。 Gets the collection of layers.
获取此数据集的人类可读名称。 Gets a human-readable name for this dataset.
readonly resource : Resource
用于获取 I3S 数据集的资源。 The resource used to fetch the I3S dataset.
确定是否显示数据集。 Determines if the dataset will be shown.
确定是否显示功能。 Determines if the features will be shown.
readonly sublayers : Array.<I3SSublayer>
获取建筑子图层的集合。 Gets the collection of building sublayers.
方法 Methods
static Cesium.I3SDataProvider.fromUrl(url, options) → Promise.<I3SDataProvider>
创建一个 I3SDataProvider。当前支持的 I3S 版本为 1.6 和 1.7/1.8 (OGC I3S 1.2)。 Creates an I3SDataProvider. Currently supported I3S versions are 1.6 and 1.7/1.8 (OGC I3S 1.2).
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
url |
string | Resource | I3S数据集的url,它应该返回一个I3S场景对象 The url of the I3S dataset, which should return an I3S scene object |
options |
I3SDataProvider.ConstructorOptions | 描述初始化选项的对象 An object describing initialization options |
返回: Returns:
示例: Examples:
try {
const i3sData = await I3SDataProvider.fromUrl(
"https://tiles.arcgis.com/tiles/z2tnIkrLQ2BRzr6P/arcgis/rest/services/Frankfurt2017_vi3s_18/SceneServer/layers/0"
);
viewer.scene.primitives.add(i3sData);
} catch (error) {
console.log(`There was an error creating the I3S Data Provider: ${error}`);
}
try {
const geoidService = await Cesium.ArcGISTiledElevationTerrainProvider.fromUrl(
"https://tiles.arcgis.com/tiles/z2tnIkrLQ2BRzr6P/arcgis/rest/services/EGM2008/ImageServer"
);
const i3sData = await I3SDataProvider.fromUrl(
"https://tiles.arcgis.com/tiles/z2tnIkrLQ2BRzr6P/arcgis/rest/services/Frankfurt2017_vi3s_18/SceneServer/layers/0", {
geoidTiledTerrainProvider: geoidService
});
viewer.scene.primitives.add(i3sData);
} catch (error) {
console.log(`There was an error creating the I3S Data Provider: ${error}`);
}
销毁该对象持有的 WebGL 资源。销毁对象可以确定性地释放 WebGL 资源,而不是依赖垃圾收集器来销毁该对象。 Destroys the WebGL resources held by this object. Destroying an object allows for deterministic release of WebGL resources, instead of relying on the garbage collector to destroy this object.
一旦对象被销毁,就不应再使用;调用除 Once an object is destroyed, it should not be used; calling any function other than
isDestroyed 将导致 will result in a DeveloperError 例外。因此,分配返回值( exception. Therefore, assign the return value (undefined) 到对象,如示例中所做的那样。 ) to the object as done in the example.
抛出: Throws:
-
DeveloperError : This object was destroyed, i.e., destroy() was called.
另见: See:
将场景的绘制元素过滤为特定的属性名称和值 Filters the drawn elements of a scene to specific attribute names and values
| 名称 Name | 类型 Type | 默认值 Default | 说明 Description |
|---|---|---|---|
filters |
Array.<I3SNode.AttributeFilter> |
[]
|
可选 optional 属性过滤器的集合 The collection of attribute filters |
返回: Returns:
应用过滤器时解决的承诺 A promise that is resolved when the filter is applied
返回所有可用属性的名称集合 Returns the collection of names for all available attributes
返回: Returns:
属性名称的集合 The collection of attribute names
返回具有给定名称的属性的值的集合 Returns the collection of values for the attribute with the given name
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
name |
string | 属性名称 The attribute name |
返回: Returns:
属性值的集合 The collection of attribute values
如果该对象被销毁则返回 true;否则为假。 Returns true if this object was destroyed; otherwise, false.
如果该对象被破坏,则不应使用它;调用除 If this object was destroyed, it should not be used; calling any function other than
isDestroyed 将导致 will result in a DeveloperError exception.
返回: Returns:
true 如果该物体被摧毁;否则, if this object was destroyed; otherwise, false.
另见: See:
类型定义 Type Definitions
I3SDataProvider 构造函数的初始化选项 Initialization options for the I3SDataProvider constructor
属性: Properties:
| 名称 Name | 类型 Type | Attributes | 默认值 Default | 说明 Description |
|---|---|---|---|---|
name |
string |
<可选> <optional> |
I3S 数据集的名称。 The name of the I3S dataset. | |
show |
boolean |
<可选> <optional> |
true | 确定是否显示数据集。 Determines if the dataset will be shown. |
geoidTiledTerrainProvider |
ArcGISTiledElevationTerrainProvider | Promise.<ArcGISTiledElevationTerrainProvider> |
<可选> <optional> |
描述地球引力模型的平铺高程提供程序。如果定义了,几何图形将根据该提供者给出的偏移量进行移动。需要将具有重力相关高度的 I3S 数据集放置在正确的位置。 Tiled elevation provider describing an Earth Gravitational Model. If defined, geometry will be shifted based on the offsets given by this provider. Required to position I3S data sets with gravity-related height at the correct location. | |
cesium3dTilesetOptions |
Cesium3DTileset.ConstructorOptions |
<可选> <optional> |
包含要传递给内部创建的选项的对象 Object containing options to pass to an internally created Cesium3DTileset。参见 . See Cesium3DTileset 获取有效属性的列表。所有选项都可以使用,除了 for list of valid properties. All options can be used with the exception of url and show 它们被 I3SDataProvider 中的值覆盖。 which are overridden by values from I3SDataProvider. |
|
showFeatures |
boolean |
<可选> <optional> |
false | 确定是否显示功能。 Determines if the features will be shown. |
adjustMaterialAlphaMode |
boolean |
<可选> <optional> |
false | 根据顶点颜色的透明度调整材质的 Alpha 模式的选项。当 The option to adjust the alpha mode of the material based on the transparency of the vertex color. When true,对于颜色顶点属性中具有任何透明度的几何体,材质的 alpha 模式(如果未定义)将设置为 BLEND。 , the alpha mode of the material (if not defined) will be set to BLEND for geometry with any transparency in the color vertex attribute. |
applySymbology |
boolean |
<可选> <optional> |
false | 确定是否将解析 I3S 符号系统并将其应用于图层。 Determines if the I3S symbology will be parsed and applied for the layers. |
calculateNormals |
boolean |
<可选> <optional> |
false | 确定是否为没有法线的 I3S 几何体生成平坦法线。 Determines if the flat normals will be generated for I3S geometry without normals. |
示例: Examples:
// Increase LOD by reducing SSE
const cesium3dTilesetOptions = {
maximumScreenSpaceError: 1,
};
const i3sOptions = {
cesium3dTilesetOptions: cesium3dTilesetOptions,
};
// Set a custom outline color to replace the color defined in I3S symbology
const cesium3dTilesetOptions = {
outlineColor: Cesium.Color.BLUE,
};
const i3sOptions = {
cesium3dTilesetOptions: cesium3dTilesetOptions,
applySymbology: true,
};
