new Cesium.Cesium3DTileset(options)

A 3D Tiles tileset, 用于流出巨大的异质3D地理空间数据集.
This object is normally not instantiated directly, use Cesium3DTileset.fromUrl.
Name Type Description
options Cesium3DTileset.ConstructorOptions 描述初始化选项的对象
Throws:
Examples:
try {
  const tileset = await Cesium.Cesium3DTileset.fromUrl(
     "http://localhost:8002/tilesets/Seattle/tileset.json"
  );
  scene.primitives.add(tileset);
} catch (error) {
  console.error(`Error creating tileset: ${error}`);
}
// Turn on camera collisions with the tileset.
try {
  const tileset = await Cesium.Cesium3DTileset.fromUrl(
     "http://localhost:8002/tilesets/Seattle/tileset.json",
     { enableCollision: true }
  );
  scene.primitives.add(tileset);
} catch (error) {
  console.error(`Error creating tileset: ${error}`);
}
// Common setting for the skipLevelOfDetail optimization
const tileset = await Cesium.Cesium3DTileset.fromUrl(
  "http://localhost:8002/tilesets/Seattle/tileset.json", {
     skipLevelOfDetail: true,
     baseScreenSpaceError: 1024,
     skipScreenSpaceErrorFactor: 16,
     skipLevels: 1,
     immediatelyLoadDesiredLevelOfDetail: false,
     loadSiblings: false,
     cullWithChildrenBounds: true
});
scene.primitives.add(tileset);
// Common settings for the dynamicScreenSpaceError optimization
const tileset = await Cesium.Cesium3DTileset.fromUrl(
  "http://localhost:8002/tilesets/Seattle/tileset.json", {
     dynamicScreenSpaceError: true,
     dynamicScreenSpaceErrorDensity: 2.0e-4,
     dynamicScreenSpaceErrorFactor: 24.0,
     dynamicScreenSpaceErrorHeightFalloff: 0.25
});
scene.primitives.add(tileset);
Experimental

Support for loading Gaussian splats content encoded with SPZ compression using the draft glTF extensions KHR_gaussian_splatting and KHR_gaussian_splatting_compression_spz_2 is experimental and is subject change without Cesium's standard deprecation policy.

See:

Members

allTilesLoaded : Event

发射事件是为了表示所有遇到屏幕空间错误的瓷砖都装入了这个框架. 瓷砖 完全装入此视图.

此事件在拍摄场景后在框架的尽头开火.

Default Value: new Event()
Example:
tileset.allTilesLoaded.addEventListener(function() {
    console.log('All tiles are loaded');
});
See:

readonly asset : object

获取 tileset 的资产对象属性,其中包含有关 tileset 的元数据 .

See the asset schema reference 在整套属性的3D平面图中.

backFaceCulling : boolean

是否要弯曲反向几何. 如果是真的, 背面的抚摸是确定的 由 glTF 材料的双Sided 属性; 当虚假时, 背面 culling 被禁用 .
Default Value: true

readonly deprecated basePath : string

The base path that non-absolute paths in tileset JSON file are relative to.

Deprecated: true

baseScreenSpaceError : number

在跳过细节级别之前必须到达的屏幕空间错误 .

Only used when Cesium3DTileset#skipLevelOfDetail is true.

Default Value: 1024

readonly boundingSphere : BoundingSphere

瓦片的边缘球体.
Example:
const tileset = await Cesium.Cesium3DTileset.fromUrl("http://localhost:8002/tilesets/Seattle/tileset.json");

viewer.scene.primitives.add(tileset);

// Set the camera to view the newly added tileset
viewer.camera.viewBoundingSphere(tileset.boundingSphere, new Cesium.HeadingPitchRange(0, -0.5, 0));

cacheBytes : number

用于缓存瓷砖的 NT %0 内存(以字节计)的量 。 这种内存使用估计来自 几何,纹理,以及装填的瓦片的批量表纹理. 对于点云,此值也 包括每个点的元数据.

不在视线内的平板被卸下以强制执行.

如果降低这一值导致卸下瓦片,则在下一个框架上卸下瓦片.

如果需要大于 NT 0 cacheBytes NT 1 的牌面才能满足 desired screen space error, determined by Cesium3DTileset#maximumScreenSpaceError, 对于当前视图,然后加载的瓷砖的内存用量将超过 NT+0 cacheBytes NT+1 由最高 NT+2 最大Cache 重叠Bytes NT+3 . 例如,如果 NT 0 cacheBytes NT 1 为500000,但600000字节 来应对屏幕空间错误, 然后是60万字节的瓦片 可能装入( 如果 NT % 0 最大缓存 OverflowBytes NT % 1 至少有 1000) . 当这些瓷砖离开视野时,它们会被卸下.

Default Value: 536870912
See:

readonly classificationType : ClassificationType

确定地形、 3D 梯度, 或两者都将被此瓦片分类 .

此选项仅适用于含有批量三维模型的瓷砖, glTF 内容,几何数据,或矢量数据. 即使未定义, 矢量 和几何数据必须构成分类,并默认为 在地形和其他3D平板上渲染.

当为批量的3D模型和 glTF 片块启用时, 有一些 glTF 上的要求/限制 :

  • The glTF cannot contain morph targets, skins, or animations.
  • The glTF cannot contain the EXT_mesh_gpu_instancing extension.
  • Only meshes with TRIANGLES can be used to classify other assets.
  • The meshes must be watertight.
  • The POSITION semantic is required.
  • If _BATCHIDs and an index buffer are both present, all indices with the same batch id must occupy contiguous sections of the index buffer.
  • If _BATCHIDs are present with no index buffer, all positions with the same batch id must occupy contiguous sections of the position buffer.

此外,不支持对点或实例3D进行分类 models.

接受分类的3D梯或地形必须不透明.

Default Value: undefined
Experimental

This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.

clippingPlanes : ClippingPlaneCollection

The ClippingPlaneCollection used to selectively disable rendering the tileset.

clippingPolygons : ClippingPolygonCollection

The ClippingPolygonCollection used to selectively disable rendering the tileset.

colorBlendAmount : number

Defines the value used to linearly interpolate between the source color and feature color when the Cesium3DTileset#colorBlendMode is MIX. 值为 0.0 的值产生源色,而值为 1.0 的值产生特征色,任何值在两者之间 生成源色和特征色的混合.
Default Value: 0.5

colorBlendMode : Cesium3DTileColorBlendMode

Defines how per-feature colors set from the Cesium API or declarative styling blend with the source colors from 原功能, NT 0 . glTF 材质或瓷砖中的每点颜色.
Default Value: -NT=0=- 翻译:

cullRequestsWhileMoving : boolean

优化选项。 不要要求瓷砖,这些瓷砖由于相机的移动而回来时可能不会被使用. 这种优化仅适用于固定的瓦片.
Default Value: true

cullRequestsWhileMovingMultiplier : number

优化选项。 移动时 culling 请求中使用的乘数 。 体型较大的是攻击性较强的 c,体型较小的ul.
Default Value: 60.0

customShader : CustomShader|undefined

一个自定义的遮蔽器,适用于瓷砖中的所有瓦片。 仅用于 内容使用 Model . 使用带有自定义阴影 Cesium3DTileStyle may lead to undefined behavior.
Default Value: undefined
Experimental

This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.

debugColorizeTiles : boolean

此属性仅用于调试;不优化用于生产.

当为每个瓦片指定随机颜色时。 用于可视化 哪些特征属于什么瓷砖,特别是在特性得到添加剂改进的情况下 可以从父母的瓷砖中取出与儿童瓷砖的特征相交.

Default Value: false

debugFreezeFrame : boolean

此属性仅用于调试;不优化用于生产.

确定是否只使用最后一个框架的瓦片进行渲染。 这个 将瓦片“ 冻结” 到上一个框架, 这样可以缩放 出来看看有什么.

Default Value: false

debugShowBoundingVolume : boolean

此属性仅用于调试;不优化用于生产.

当真实时, 使每个可见的瓦片的边框音量 。 边框音量是 白色,如果瓦片有内容边框音量或为空;否则为红色。 碰不到的瓷砖 屏幕空间误差, 并且仍在精炼到他们的后代是黄色的.

Default Value: false

debugShowContentBoundingVolume : boolean

此属性仅用于调试;不优化用于生产.

当真实时, 使每个可见的瓦片内容的边框音量 。 边框音量是 蓝色, 如果瓷砖有内容边框; 否则是红色 .

Default Value: false

debugShowGeometricError : boolean

此属性仅用于调试;不优化用于生产.

当为真时,绘制标签以指示每个瓦的几何错误.

Default Value: false

debugShowMemoryUsage : boolean

此属性仅用于调试;不优化用于生产.

当真实时,绘制标签以表示每块瓦的几何和纹理内存使用情况.

Default Value: false

debugShowRenderingStatistics : boolean

此属性仅用于调试;不优化用于生产.

当真实时,绘制标签以指示每个瓦片的命令,点,三角和特征的数量.

Default Value: false

debugShowUrl : boolean

此属性仅用于调试;不优化用于生产.

当为真时, 绘制标签以显示每块瓷砖的url .

Default Value: false

debugShowViewerRequestVolume : boolean

此属性仅用于调试;不优化用于生产.

当真实时, 使每个瓦片的查看器请求量 .

Default Value: false

debugWireframe : boolean

此属性仅用于调试;不优化用于生产.

如果是真的,就把每块瓷砖作为钢丝架.

Default Value: false

dynamicScreenSpaceError : boolean

优化选项。 对于街平面视野视图,使用离相机较远的低分辨率瓦片. 这样可以减少 数据加载并改进了平面集加载时间,在距离上视觉质量略有下降.

当相机靠近平面时,这种优化最强 地平线 此外,结果更准确,可以严格地装配盒装和区域等捆绑量.

Default Value: true

dynamicScreenSpaceErrorDensity : number

Similar to Fog#density, this option controls the camera distance at which the Cesium3DTileset#dynamicScreenSpaceError 优化适用。 较大的数值会使得靠近相机的瓦片受到影响. 此值必须是 non-negative.

这一优化工作通过将平板屏幕空间误差( SSE )卷下来,与相机距离类似钟曲线. 这样做的效果是选择离相机很远的分辨率较低的瓦片. 在镜头附近,没有调整 made. For tiles further away, the SSE is reduced by up to Cesium3DTileset#dynamicScreenSpaceErrorFactor (按错误的像素衡量).

增加密度使钟曲线变窄,因此靠近相机的瓷砖受到影响. 这是无谓的 把雾移到相机附近.

当密度为0时,优化不会对瓷砖产生任何影响.

Default Value: 2.0e-4

dynamicScreenSpaceErrorFactor : number

A parameter that controls the intensity of the Cesium3DTileset#dynamicScreenSpaceError optimization for 地平线上的瓷砖. 较大的值会导致分辨率降低的瓦片加载,稍稍改善运行时间性能 降低视觉质量。 数值必须是非负值.

更具体地说,这个参数代表了对像素中显示的平方块空间错误( SSE )的最大调整 far away from the camera. See Cesium3DTileset#dynamicScreenSpaceErrorDensity for more details about how 这个优化有效.

当 NT 0 因子被设定为0时,优化不会对砖块产生影响.

Default Value: 24.0

dynamicScreenSpaceErrorHeightFalloff : number

A ratio of the tileset's height that determines "street level" for the Cesium3DTileset#dynamicScreenSpaceError 优化。 当相机低于此高度时, 动态屏幕空间误差优化将达到最大值 效果,它会超过这个值。 有效值在0.0至1.0之间.

Default Value: 0.25

readonly ellipsoid : Ellipsoid

获得描述地球形状的椭圆形.

enableCollision : boolean

If true, allows collisions for camera collisions or picking. While this is true the camera will be prevented from going in or below the tileset surface if ScreenSpaceCameraController#enableCollisionDetection is true. This can have performance implecations if the tileset contains tile with a larger number of vertices.
Default Value: false

readonly environmentMapManager : DynamicEnvironmentMapManager

在这个模型上管理动态环境图的属性. 影响照明.
Example:
// Change the ground color used for a tileset's environment map to a forest green
const environmentMapManager = tileset.environmentMapManager;
environmentMapManager.groundColor = Cesium.Color.fromCssColorString("#203b34");

examineVectorLinesFunction : function

用于检查矢量线流中的函数 .
Experimental

This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.

readonly extensions : object

获取 tileset 扩展对象属性 .

readonly extras : *

Returns the extras property at the top-level of the tileset JSON, which contains application specific metadata. 如果 NT 2 extras NT 3 不存在,则返回 NT 0 未定义 NT 1 .
See:

featureIdLabel : string

用于采样和造型的特性ID集的标签 .

对于EXT mesh features,这是特性ID的标签属性,或 “ featureId N”(其中N是特性Ids阵列中的索引) 当不是时 页:1 EXT feature metadata 没有标签字段, 因此 特性 ID 集总是标注“ featureId N ” ,其中 N 是索引 全部特性ID的列表,其中特性 ID 属性在前面列出 特性标识纹理.

如果特性IdLabel设定为整数 N,则转换为 字符串“ featureId N” 自动。 如果两者兼有 存在 per-instance 特征 ID , 实例 特征 ID 使用 priority.

Experimental

This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.

foveatedConeSize : number

Optimization option. Used when Cesium3DTileset#foveatedScreenSpaceError is true to control the cone size that determines which tiles are deferred. Tiles that are inside this cone are loaded immediately. Tiles outside the cone are potentially deferred based on how far outside the cone they are and Cesium3DTileset#foveatedInterpolationCallback and Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation. 设定为 0.0 表示圆锥将是由相机位置及其视野方向形成的线条. 设定为1.0表示圆锥包含摄像头的整个视野,本质上使效果失效.
Default Value: 0.3

foveatedInterpolationCallback : Cesium3DTileset.foveatedInterpolationCallback

获得或设置回调,以控制在foveted圆锥体外提高屏幕空间误差的多少, interpolating between Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation and Cesium3DTileset#maximumScreenSpaceError.

foveatedMinimumScreenSpaceErrorRelaxation : number

Optimization option. Used when Cesium3DTileset#foveatedScreenSpaceError is true to control the starting screen space error relaxation for tiles outside the foveated cone. 屏幕空间错误将基于提供的 {NT}\\\\\\\\\从此值开始提升至 {NT}\\\\\\\\\\\\\\\\\\\\\.
Default Value: 0.0

foveatedScreenSpaceError : boolean

优化选项。 在屏幕中央优先加载瓷砖 屏幕边缘处的牌片空间错误。 屏幕空间错误一旦全部恢复为正常 the tiles in the center of the screen as determined by the Cesium3DTileset#foveatedConeSize are loaded.
Default Value: true

foveatedTimeDelay : number

Optimization option. Used when Cesium3DTileset#foveatedScreenSpaceError is true to control 相机停止移动后,等待多久 推迟的瓷砖开始加载. 这种时间的延迟防止了相机移动时在屏幕边缘周围请求瓦片. 设定为 0.0 将立即请求在任何给定视图中的所有牌 .
Default Value: 0.2

readonly heightReference : HeightReference|undefined

指定高度相对于地形、三维梯度或两者.

此选项仅适用于含有矢量数据的瓷砖中的指点特性 . 此选项需要查看器的场景通过 options.scene 通过.

Default Value: undefined
Experimental

This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.

imageBasedLighting : ImageBasedLighting

管理此平板电脑上基于图像的照明的属性 .

readonly imageryLayers : ImageryLayerCollection

The collection of ImageryLayer objects providing 2D georeferenced 将在砖块上渲染的图像数据. 图片会在glTF, B3DM , PNTS , 或GeoJSON的瓦片内容上绘制 .
Example:
// Drape Bing Maps Aerial imagery over the tileset
const imageryProvider = await Cesium.createWorldImageryAsync({
  style: Cesium.IonWorldImageryStyle.AERIAL,
});
const imageryLayer = new ImageryLayer(imageryProvider);
tileset.imageryLayers.add(imageryLayer);
Experimental

This feature is not final and is subject to change without Cesium's standard deprecation policy.

See:

immediatelyLoadDesiredLevelOfDetail : boolean

当真实时, 只有符合最大屏幕空间错误的牌片才会被下载 . 跳过因子被忽略, 只装入想要的牌片 .

Only used when Cesium3DTileset#skipLevelOfDetail is true.

Default Value: false

initialTilesLoaded : Event

发射事件是为了表示所有遇到屏幕空间错误的瓷砖都装入了这个框架. 这个事件 当初始视图中的所有瓷砖都装入时,就会发射一次.

此事件在拍摄场景后在框架的尽头开火.

Default Value: new Event()
Example:
tileset.initialTilesLoaded.addEventListener(function() {
    console.log('Initial tiles are loaded');
});
See:

instanceFeatureIdLabel : string

用于采摘和造型的示例特征标识集的标签 .

如果实例FeatureIdLabel设定为整数 N,则转换为 字符串“ InstanceFeatureId N” 自动. 如果有每个原始特征的识别码和普通特征的识别码,则 实例特征标识优先.

Experimental

This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.

lightColor : Cartesian3

阴影模型时的淡色. 当 NT 0 未定义 NT 1 取而代之的是场景的浅色.

例如,通过设置使额外光源失效 tileset.imageBasedLighting.imageBasedLightingFactor = new Cartesian2(0.0, 0.0) 砖头会变暗 在这里,增加光源的强度会使瓷砖更亮.

Default Value: undefined

loadProgress : Event

这次事件是为了表明加载新瓷砖的进展。 此事件在新瓦片时被解除 当所请求的瓷砖下载完成时,以及下载的瓷砖已经下载时,请求 已处理完毕,准备完成.

The number of pending tile requests, numberOfPendingRequests, and number of tiles 处理中, 数字 TilesProcessing 被传递给事件听众.

此事件在拍摄场景后在框架的尽头开火.

Default Value: new Event()
Example:
tileset.loadProgress.addEventListener(function(numberOfPendingRequests, numberOfTilesProcessing) {
    if ((numberOfPendingRequests === 0) && (numberOfTilesProcessing === 0)) {
        console.log('Stopped loading');
        return;
    }

    console.log(`Loading: requests: ${numberOfPendingRequests}, processing: ${numberOfTilesProcessing}`);
});

loadSiblings : boolean

确定可见瓦片的兄弟姐妹是否总是在翻转时下载. 这可能有助于确保当查看器左/右转向时,瓷砖已经可用 .

Only used when Cesium3DTileset#skipLevelOfDetail is true.

Default Value: false

maximumCacheOverflowBytes : number

用于缓存瓷砖的 NT% 0 内存的最大额外量( 以字节计) .

如果砖块的大小大于 NT 0 cachets NT 1 + NT 2 最大 Cache 重叠Bytes NT 3 需要满足预期的屏幕空间错误,由 Cesium3DTileset#maximumScreenSpaceError for the current view, then Cesium3DTileset#memoryAdjustedScreenSpaceError will be adjusted 直到满足调整后的屏幕空格所需的牌使用更少 比 NT 0 cacheBytes NT 1 + NT 2 最大cache 重叠Bytes NT 3 .

Default Value: 536870912
See:

maximumScreenSpaceError : number

最大屏幕空间误差用于驱动详细度的改进. 此值帮助确定一个瓦片何时 完善其后代,因此在平衡性能和视觉质量方面发挥着重要作用.

砖块的屏幕空间错误大致相当于宽度的像素数量,如果一个球体带有一个 半径等于瓦片的 NT 0 几何误差 NT 1 在瓦片的位置得到渲染. 如果该值超过 最大空间 Error NT 0 最大空间 Error NT 1 瓷砖精炼其后代.

视砖块的不同, NT 0 最大空间 Error NT 1 可能需要调整,以实现适当的平衡. 更高的值提供更好的性能,但视觉质量较低.

Default Value: 16

modelMatrix : Matrix4

4x4变换矩阵,可以改变整个瓷砖.
Default Value: Matrix4.IDENTITY
Example:
// Adjust a tileset's height from the globe's surface.
const heightOffset = 20.0;
const boundingSphere = tileset.boundingSphere;
const cartographic = Cesium.Cartographic.fromCartesian(boundingSphere.center);
const surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0.0);
const offset = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, heightOffset);
const translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3());
tileset.modelMatrix = Cesium.Matrix4.fromTranslation(translation);

outlineColor : Color

渲染大纲时使用的颜色 .
Default Value: Color.BLACK

pointCloudShading : PointCloudShading

基于几何误差和眼穹照明的控制点大小的选项.

preferLeaves : boolean

优化选项。 先加载叶子.
Default Value: false

preloadFlightDestinations : boolean

优化选项。 在摄影机飞行时,在摄像头的飞行目的地取瓷砖.
Default Value: true

preloadWhenHidden : boolean

当 NT Q4 为 NT 2 false NT Q 3 时预装牌. 装入瓦片时,仿佛砖块是可见的,但不会使其变形.
Default Value: false

progressiveResolutionHeightFraction : number

Optimization option. If between (0.0, 0.5], tiles at or above the screen space error for the reduced screen resolution of progressiveResolutionHeightFraction*screenHeight will be prioritized first. This can help get a quick layer of tiles down while full resolution tiles continue to load.
Default Value: 0.3

readonly properties : object

获取 tileset 的属性词典对象,其中包含每个地貌属性的元数据.

See the properties schema reference 在整套属性的3D平面图中.

Example:
console.log(`Maximum building height: ${tileset.properties.height.maximum}`);
console.log(`Minimum building height: ${tileset.properties.height.minimum}`);
See:

readonly resource : Resource

The resource used to fetch the tileset JSON file

readonly root : Cesium3DTile

The root tile.

shadows : ShadowMode

确定平板是投影还是接收来自光源的阴影.

赋能阴影具有性能影响. 投影的瓦片必须两次制成,一次从镜头,另一次从光线的角度.

阴影只有在 Viewer#shadows 时才会渲染.

Default Value: ShadowMode.ENABLED

show : boolean

确定是否显示平板.
Default Value: true

showCreditsOnScreen : boolean

确定是否在屏幕上显示瓷砖的信用值
Default Value: false

showOutline : boolean

是否使用 CESIUM_primitive_outline extension. 当真实时, 显示大纲 。 当错误时, 大纲不显示 .
Default Value: true

skipLevelOfDetail : boolean

优化选项。 确定在转弯时是否应用跳过的细节级别 .

替换-精炼转盘的共同策略是将树的所有级别储存在记忆中,并要求 所有要上膛的孩子 父母可以完善。 通过树的这种优化水平可以跳过 儿童可以与父母一起出生。 瓦片需要的内存要少得多 使用此优化.

Default Value: false

skipLevels : number

恒定定义加载瓷砖时要跳过的最小关数 。 当它是0, 没有跳过关卡 . 例如,如果一个瓦片是第1级的,则不会加载任何瓦片,除非其级别大于第2级.

Only used when Cesium3DTileset#skipLevelOfDetail is true.

Default Value: 1

skipScreenSpaceErrorFactor : number

乘以定义最小屏幕空间错误以跳过 . 例如,如果一个瓦片的屏幕空间错误为100,则不会加载任何瓦片,除非它们 是叶或有屏幕空间错误 NT 0 NT 1 .

Only used when Cesium3DTileset#skipLevelOfDetail is true.

Default Value: 16

splitDirection : SplitDirection

The SplitDirection to apply to this tileset.
Default Value: SplitDirection.NONE

style : Cesium3DTileStyle|undefined

样式, 使用 3D Tiles Styling language, 适用于砖块中的每个特性.

Assign undefined to remove the style, which will restore the visual 当没有应用样式时,显示砖块到默认值.

The style is applied to a tile before the Cesium3DTileset#tileVisible 事件被提高,所以在 NT 0 tileVisible NT 1 中的代码可以手动设置一个特性的 属性 ( NT 0 . 颜色和显示) 在样式应用后。 何时 一个新样式被指定了任何手动设置的属性被覆盖.

使用“ true” 条件指定所有非对象的颜色 被原有的条件所压倒. 否则,默认颜色为 NT %1 将被使用。 类似地, 使用总是“ true” 的条件来指定显示属性 用于所有没有被先前条件覆盖的物体。 否则 将使用默认显示值 true .

Default Value: undefined
Example:
tileset.style = new Cesium.Cesium3DTileStyle({
   color : {
       conditions : [
           ['${Height} >= 100', 'color("purple", 0.5)'],
           ['${Height} >= 50', 'color("red")'],
           ['true', 'color("blue")']
       ]
   },
   show : '${Height} > 0',
   meta : {
       description : '"Building id ${id} has height ${Height}."'
   }
});
See:

tileFailed : Event

该事件是为了表明一瓷砖的内容未能加载.

如果没有事件听众,错误消息会登录到控制台.

传递给听众的错误对象包含两个属性:

  • url: the url of the failed tile.
  • message: the error message.

如果存在多个内容,则此事件每内含内容都会被提出一次并有错误.

Default Value: new Event()
Example:
tileset.tileFailed.addEventListener(function(error) {
    console.log(`An error occurred loading tile: ${error.url}`);
    console.log(`Error: ${error.message}`);
});

tileLoad : Event

该事件是为了表明一瓷砖的内容被装上.

装入的 Cesium3DTile 传递给事件听众.

此事件在调制框架时在平板转盘时发射 因此,对瓦片的更新在同一框架中生效。 不创建或修改 NT 0 事件听器期间的实体或原始人.

Default Value: new Event()
Example:
tileset.tileLoad.addEventListener(function(tile) {
    console.log('A tile was loaded.');
});

readonly tilesLoaded : boolean

When true, all tiles that meet the screen space error this frame are loaded. The tileset is 完全装入此视图 .
Default Value: false
See:

tileUnload : Event

该事件是为了表明一瓷砖的内容被卸下.

卸载的 Cesium3DTile 被传递给事件听众.

此事件在瓦片内容卸下之前即已发射 使事件听众能够查阅瓷砖的内容。 不创建 or modify Cesium entities or primitives during the event listener.

Default Value: new Event()
Example:
tileset.tileUnload.addEventListener(function(tile) {
    console.log('A tile was unloaded from the cache.');
});
See:

tileVisible : Event

此事件会在框架内为每个可见的瓦片发射一次. 可用手动操作 样式.

可见的 Cesium3DTile 传递给事件听众.

此事件在调制框架时在平板转盘时发射 因此,对瓦片的更新在同一框架中生效。 不创建或修改 NT 0 事件听器期间的实体或原始人.

Default Value: new Event()
Examples:
tileset.tileVisible.addEventListener(function(tile) {
    if (tile.content instanceof Cesium.Model3DTileContent) {
        console.log('A 3D model tile is visible.');
    }
});
// Apply a red style and then manually set random colors for every other feature when the tile becomes visible.
tileset.style = new Cesium.Cesium3DTileStyle({
    color : 'color("red")'
});
tileset.tileVisible.addEventListener(function(tile) {
    const content = tile.content;
    const featuresLength = content.featuresLength;
    for (let i = 0; i < featuresLength; i+=2) {
        content.getFeature(i).color = Cesium.Color.fromRandom();
    }
});

readonly timeSinceLoad : number

返回时间, 以毫秒计, 因为瓷砖已经装入并首次更新 .

readonly totalMemoryUsageInBytes : number

以平板块使用的字节表示的 GPU 内存总量. 此值估算自 几何,纹理,批量表纹理,以及装填的瓦片的二进制元数据.
See:

vectorClassificationOnly : boolean

表示应只使用瓷砖的矢量瓦进行分类.
Default Value: false
Experimental

This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.

vectorKeepDecodedPositions : boolean

矢量牌是否应该保留内存中的解码位置 . This is used with Cesium3DTileFeature.getPolylinePositions.
Default Value: false
Experimental

This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.

Methods

static Cesium.Cesium3DTileset.fromIonAssetId(assetId, options)Promise.<Cesium3DTileset>

Creates a 3D Tiles tileset, 用于流出巨大的异质的3D地理空间数据集,来自 NT 0 离子资产ID.
Name Type Description
assetId number The Cesium ion asset id.
options Cesium3DTileset.ConstructorOptions optional 描述初始化选项的对象
Returns:
Throws:
  • RuntimeError : When the tileset asset version is not 0.0, 1.0, or 1.1, 或当平板中包含一个不需要支持的扩展.
Example:
// Load a Cesium3DTileset with a Cesium ion asset ID of 124624234
try {
  const tileset = await Cesium.Cesium3DTileset.fromIonAssetId(124624234);
  scene.primitives.add(tileset);
} catch (error) {
  console.error(`Error creating tileset: ${error}`);
}
See:
  • Cesium3DTileset#fromUrl

static Cesium.Cesium3DTileset.fromUrl(url, options)Promise.<Cesium3DTileset>

Creates a 3D Tiles tileset, 用于流出巨大的异质3D地理空间数据集.
Name Type Description
url Resource | string The url to a tileset JSON file.
options Cesium3DTileset.ConstructorOptions optional 描述初始化选项的对象
Returns:
Throws:
  • RuntimeError : When the tileset asset version is not 0.0, 1.0, or 1.1, 或当平板中包含一个不需要支持的扩展.
Examples:
try {
  const tileset = await Cesium.Cesium3DTileset.fromUrl(
     "http://localhost:8002/tilesets/Seattle/tileset.json"
  );
  scene.primitives.add(tileset);
} catch (error) {
  console.error(`Error creating tileset: ${error}`);
}
// Common setting for the skipLevelOfDetail optimization
const tileset = await Cesium.Cesium3DTileset.fromUrl(
  "http://localhost:8002/tilesets/Seattle/tileset.json", {
     skipLevelOfDetail: true,
     baseScreenSpaceError: 1024,
     skipScreenSpaceErrorFactor: 16,
     skipLevels: 1,
     immediatelyLoadDesiredLevelOfDetail: false,
     loadSiblings: false,
     cullWithChildrenBounds: true
});
scene.primitives.add(tileset);
// Common settings for the dynamicScreenSpaceError optimization
const tileset = await Cesium.Cesium3DTileset.fromUrl(
  "http://localhost:8002/tilesets/Seattle/tileset.json", {
     dynamicScreenSpaceError: true,
     dynamicScreenSpaceErrorDensity: 2.0e-4,
     dynamicScreenSpaceErrorFactor: 24.0,
     dynamicScreenSpaceErrorHeightFalloff: 0.25
});
scene.primitives.add(tileset);
See:
  • Cesium3DTileset#fromIonAssetId

static Cesium.Cesium3DTileset.loadJson(tilesetUrl)Promise.<object>

提供一个钩子来覆盖用于请求 tileset json 的方法 从远程服务器获取瓷砖时有用
Name Type Description
tilesetUrl Resource | string 要获取的 Json 文件的url
Returns:
一个能解决Json数据的承诺

destroy()

Destroys the WebGL resources held by this object. Destroying an object allows for deterministic 释放 WebGL 资源,而不是依赖垃圾收集器来摧毁此对象.

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.
Example:
tileset = tileset && tileset.destroy();
See:

getHeight(cartographic, scene)number|undefined

在给定的制图中获取加载表面的高度 。 此函数将只考虑加载的瓷砖的网格,而不是不考虑一个瓷砖最详细的瓦片。 此函数在采样点云时总是返回未定义的值 .
Name Type Description
cartographic Cartographic 寻找高度的地图.
scene Scene 出现视觉的场景.
Returns:
无法找到地图的高度或未定义 .
Example:
const tileset = await Cesium.Cesium3DTileset.fromIonAssetId(124624234);
scene.primitives.add(tileset);

const height = tileset.getHeight(scene.camera.positionCartographic, scene);

hasExtension(extensionName)boolean

true if the tileset JSON file lists the extension in extensionsUsed; otherwise, false.
Name Type Description
extensionName string 要检查的扩展名 .
Returns:
true if the tileset JSON file lists the extension in extensionsUsed; otherwise, false.

isDestroyed()boolean

如果此对象被销毁, 返回真实; 否则, 错误 .

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:

makeStyleDirty()

Marks the tileset's Cesium3DTileset#style as dirty, which forces all 在下一个框中重新评价样式的特性可见.

trimLoadedTiles()

卸载所有未选择上一个框架的瓷砖 。 这可以用来 明确管理瓷砖缓存并减少下面装入的瓷砖总数 Cesium3DTileset#cacheBytes.

Tile unloads occur at the next frame to keep all the WebGL delete calls 在渲染循环中.

Type Definitions

Cesium.Cesium3DTileset.ConstructorOptions

NT 0 构造器的初始化选项
Properties:
Name Type Attributes Default Description
show boolean <optional>
true Determines if the tileset will be shown.
modelMatrix Matrix4 <optional>
Matrix4.IDENTITY A 4x4 transformation matrix that transforms the tileset's root tile.
modelUpAxis Axis <optional>
Axis.Y Which axis is considered up when loading models for tile contents.
modelForwardAxis Axis <optional>
Axis.X Which axis is considered forward when loading models for tile contents.
shadows ShadowMode <optional>
ShadowMode.ENABLED Determines whether the tileset casts or receives shadows from light sources.
maximumScreenSpaceError number <optional>
16 用于驱动细节精细度的最大屏幕空间误差.
cacheBytes number <optional>
536870912 The size (in bytes) to which the tile cache will be trimmed, if the cache contains tiles not needed for the current view.
maximumCacheOverflowBytes number <optional>
536870912 The maximum additional memory (in bytes) to allow for cache headroom, if more than Cesium3DTileset#cacheBytes are needed for the current view.
cullWithChildrenBounds boolean <optional>
是否要使用孩子的结合方式将瓦片粘合在一起.
cullRequestsWhileMoving boolean <optional>
不要要求瓷砖,这些瓷砖由于相机的移动而回来时可能不会被使用. 这种优化仅适用于固定的瓦片.
cullRequestsWhileMovingMultiplier number <optional>
60.0 Optimization option. Multiplier used in culling requests while moving. Larger is more aggressive culling, smaller less aggressive culling.
preloadWhenHidden boolean <optional>
false Preload tiles when tileset.show is false. Loads tiles as if the tileset is visible but does not render them.
preloadFlightDestinations boolean <optional>
在摄影机飞行时在摄影机的飞行目的地预装瓦片.
preferLeaves boolean <optional>
false 先加载叶子.
dynamicScreenSpaceError boolean <optional>
对于街平面视野视图,使用离相机较远的低分辨率瓦片. 这样可以减少数据加载量,改善砖块加载时间,在距离上视觉质量略有下降.
dynamicScreenSpaceErrorDensity number <optional>
2.0e-4 Similar to Fog#density, this option controls the camera distance at which the Cesium3DTileset#dynamicScreenSpaceError optimization applies. Larger values will cause tiles closer to the camera to be affected.
dynamicScreenSpaceErrorFactor number <optional>
24.0 A parameter that controls the intensity of the Cesium3DTileset#dynamicScreenSpaceError optimization for tiles on the horizon. Larger values cause lower resolution tiles to load, improving runtime performance at a slight reduction of visual quality.
dynamicScreenSpaceErrorHeightFalloff number <optional>
0.25 A ratio of the tileset's height that determines where "street level" camera views occur. When the camera is below this height, the Cesium3DTileset#dynamicScreenSpaceError optimization will have the maximum effect, and it will roll off above this value.
progressiveResolutionHeightFraction number <optional>
0.3 Optimization option. If between (0.0, 0.5], tiles at or above the screen space error for the reduced screen resolution of progressiveResolutionHeightFraction*screenHeight will be prioritized first. This can help get a quick layer of tiles down while full resolution tiles continue to load.
foveatedScreenSpaceError boolean <optional>
true Optimization option. Prioritize loading tiles in the center of the screen by temporarily raising the screen space error for tiles around the edge of the screen. Screen space error returns to normal once all the tiles in the center of the screen as determined by the Cesium3DTileset#foveatedConeSize are loaded.
foveatedConeSize number <optional>
0.1 Optimization option. Used when Cesium3DTileset#foveatedScreenSpaceError is true to control the cone size that determines which tiles are deferred. Tiles that are inside this cone are loaded immediately. Tiles outside the cone are potentially deferred based on how far outside the cone they are and their screen space error. This is controlled by Cesium3DTileset#foveatedInterpolationCallback and Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation. Setting this to 0.0 means the cone will be the line formed by the camera position and its view direction. Setting this to 1.0 means the cone encompasses the entire field of view of the camera, disabling the effect.
foveatedMinimumScreenSpaceErrorRelaxation number <optional>
0.0 Optimization option. Used when Cesium3DTileset#foveatedScreenSpaceError is true to control the starting screen space error relaxation for tiles outside the foveated cone. The screen space error will be raised starting with tileset value up to Cesium3DTileset#maximumScreenSpaceError based on the provided Cesium3DTileset#foveatedInterpolationCallback.
foveatedInterpolationCallback Cesium3DTileset.foveatedInterpolationCallback <optional>
Math.lerp Optimization option. Used when Cesium3DTileset#foveatedScreenSpaceError is true to control how much to raise the screen space error for tiles outside the foveated cone, interpolating between Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation and Cesium3DTileset#maximumScreenSpaceError
foveatedTimeDelay number <optional>
0.2 Optimization option. Used when Cesium3DTileset#foveatedScreenSpaceError is true to control how long in seconds to wait after the camera stops moving before deferred tiles start loading in. This time delay prevents requesting tiles around the edges of the screen when the camera is moving. Setting this to 0.0 will immediately request all tiles in any given view.
skipLevelOfDetail boolean <optional>
false 确定在转弯时是否应用跳过的细节级别 .
baseScreenSpaceError number <optional>
1024 When skipLevelOfDetail is true, the screen space error that must be reached before skipping levels of detail.
skipScreenSpaceErrorFactor number <optional>
16 当 NT 0 skipLevelFOF NT 1 为 NT 2 rect NT 3 时,一个乘数定义最小屏幕空间错误以跳过. 与 skipLevels 一起使用,以确定要加载的瓷砖.
skipLevels number <optional>
1 When skipLevelOfDetail is true, a constant defining the minimum number of levels to skip when loading tiles. When it is 0, no levels are skipped. Used in conjunction with skipScreenSpaceErrorFactor to determine which tiles to load.
immediatelyLoadDesiredLevelOfDetail boolean <optional>
false When skipLevelOfDetail is true, only tiles that meet the maximum screen space error will ever be downloaded. Skipping factors are ignored and just the desired tiles are loaded.
loadSiblings boolean <optional>
false When skipLevelOfDetail is true, determines whether siblings of visible tiles are always downloaded during traversal.
clippingPlanes ClippingPlaneCollection <optional>
The ClippingPlaneCollection used to selectively disable rendering the tileset.
clippingPolygons ClippingPolygonCollection <optional>
The ClippingPolygonCollection used to selectively disable rendering the tileset.
classificationType ClassificationType <optional>
Determines whether terrain, 3D Tiles or both will be classified by this tileset. See Cesium3DTileset#classificationType for details about restrictions and limitations.
heightReference HeightReference <optional>
Sets the HeightReference for point features in vector tilesets.
scene Scene <optional>
The CesiumWidget#scene that the tileset will be rendered in, required for tilesets that specify a heightReference value for clamping 3D Tiles vector data content- like points, lines, and labels- to terrain or 3D tiles.
ellipsoid Ellipsoid <optional>
Ellipsoid.WGS84 The ellipsoid determining the size and shape of the globe.
pointCloudShading object <optional>
根据几何误差和照明来构建控制点衰减的 PointCloudShading 对象的选项.
lightColor Cartesian3 <optional>
阴影模型时的淡色. 当 NT 0 未定义 NT 1 取而代之的是场景的浅色.
imageBasedLighting ImageBasedLighting <optional>
用于管理此平板电脑基于图像的照明的属性 .
environmentMapOptions DynamicEnvironmentMapManager.ConstructorOptions <optional>
管理此瓦片上的动态环境映射的属性 .
backFaceCulling boolean <optional>
true Whether to cull back-facing geometry. When true, back face culling is determined by the glTF material's doubleSided property; when false, back face culling is disabled.
enableShowOutline boolean <optional>
true Whether to enable outlines for models using the CESIUM_primitive_outline extension. This can be set to false to avoid the additional processing of geometry at load time. When false, the showOutlines and outlineColor options are ignored.
showOutline boolean <optional>
true Whether to display the outline for models using the CESIUM_primitive_outline extension. When true, outlines are displayed. When false, outlines are not displayed.
outlineColor Color <optional>
Color.BLACK The color to use when rendering outlines.
vectorClassificationOnly boolean <optional>
false Indicates that only the tileset's vector tiles should be used for classification.
vectorKeepDecodedPositions boolean <optional>
false Whether vector tiles should keep decoded positions in memory. This is used with Cesium3DTileFeature.getPolylinePositions.
featureIdLabel string | number <optional>
"featureId_0" Label of the feature ID set to use for picking and styling. For EXT_mesh_features, this is the feature ID's label property, or "featureId_N" (where N is the index in the featureIds array) when not specified. EXT_feature_metadata did not have a label field, so such feature ID sets are always labeled "featureId_N" where N is the index in the list of all feature Ids, where feature ID attributes are listed before feature ID textures. If featureIdLabel is an integer N, it is converted to the string "featureId_N" automatically. If both per-primitive and per-instance feature IDs are present, the instance feature IDs take priority.
instanceFeatureIdLabel string | number <optional>
"instanceFeatureId_0" Label of the instance feature ID set used for picking and styling. If instanceFeatureIdLabel is set to an integer N, it is converted to the string "instanceFeatureId_N" automatically. If both per-primitive and per-instance feature IDs are present, the instance feature IDs take priority.
showCreditsOnScreen boolean <optional>
false Whether to display the credits of this tileset on screen.
splitDirection SplitDirection <optional>
SplitDirection.NONE The SplitDirection split to apply to this tileset.
enableCollision boolean <optional>
false When true, enables collisions for camera or CPU picking. While this is true the camera will be prevented from going below the tileset surface if ScreenSpaceCameraController#enableCollisionDetection is true. This also affects the behavior of HeightReference.CLAMP_TO_GROUND when clamping to 3D Tiles surfaces. If enableCollision is false, entities may not be correctly clamped to the tileset geometry.
projectTo2D boolean <optional>
false Whether to accurately project the tileset to 2D. If this is true, the tileset will be projected accurately to 2D, but it will use more memory to do so. If this is false, the tileset will use less memory and will still render in 2D / CV mode, but its projected positions may be inaccurate. This cannot be set after the tileset has been created.
enablePick boolean <optional>
false Whether to allow collision and CPU picking with pick when using WebGL 1. If using WebGL 2 or above, this option will be ignored. If using WebGL 1 and this is true, the pick operation will work correctly, but it will use more memory to do so. If running with WebGL 1 and this is false, the model will use less memory, but pick will always return undefined. This cannot be set after the tileset has loaded.
asynchronouslyLoadImagery boolean <optional>
false Whether loading imagery that is draped over the tileset should be done asynchronously. If this is true, then tile content will be displayed with its original texture until the imagery texture is loaded. If this is false, then the tile content will not be displayed until the imagery is ready.
debugHeatmapTilePropertyName string <optional>
以加热图表示颜色的瓦片变量 。 所有制成的瓷砖将相对对方指定的可变值进行色化.
debugFreezeFrame boolean <optional>
false For debugging only. Determines if only the tiles from last frame should be used for rendering.
debugColorizeTiles boolean <optional>
false For debugging only. When true, assigns a random color to each tile.
enableDebugWireframe boolean <optional>
false For debugging only. This must be true for debugWireframe to work in WebGL1. This cannot be set after the tileset has been created.
debugWireframe boolean <optional>
false For debugging only. When true, render's each tile's content as a wireframe.
debugShowBoundingVolume boolean <optional>
false For debugging only. When true, renders the bounding volume for each tile.
debugShowContentBoundingVolume boolean <optional>
false For debugging only. When true, renders the bounding volume for each tile's content.
debugShowViewerRequestVolume boolean <optional>
false For debugging only. When true, renders the viewer request volume for each tile.
debugShowGeometricError boolean <optional>
false For debugging only. When true, draws labels to indicate the geometric error of each tile.
debugShowRenderingStatistics boolean <optional>
false For debugging only. When true, draws labels to indicate the number of commands, points, triangles and features for each tile.
debugShowMemoryUsage boolean <optional>
false For debugging only. When true, draws labels to indicate the texture and geometry memory in megabytes used by each tile.
debugShowUrl boolean <optional>
false For debugging only. When true, draws labels to indicate the url of each tile.

Cesium.Cesium3DTileset.foveatedInterpolationCallback(p, q, time)number

优化选项。 当 {NT}\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\, interpolating between Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation and Cesium3DTileset#maximumScreenSpaceError.
Name Type Description
p number 插图的起始值 .
q number 插图的最终值 .
time number 内插时间一般在 NT 0 [0.0,1.0] NT 1 .
Returns:
内插值.
Default Value: Math.lerp
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.