English中文

TerrainProvider

new Cesium.TerrainProvider()

提供椭球体表面的地形或其他几何形状。表面几何形状根据以下方式组织成瓷砖金字塔: Provides terrain or other geometry for the surface of an ellipsoid. The surface geometry is organized into a pyramid of tiles according to a TilingScheme。该类型描述了一个接口,并不打算直接实例化。 . This type describes an interface and is not intended to be instantiated directly.
另见: See:

成员 Members

static Cesium.TerrainProvider.heightmapTerrainQuality : number

指定从高度图创建的地形的质量。值为 1.0 将确保相邻高度图顶点的间隔不超过 Specifies the quality of terrain created from heightmaps. A value of 1.0 will ensure that adjacent heightmap vertices are separated by no more than Globe.maximumScreenSpaceError 屏幕像素,并且可能会非常慢。值为 0.5 会将估计的零级几何误差减半,从而允许相邻高度图顶点之间的屏幕像素增加两倍,从而渲染得更快。 screen pixels and will probably go very slowly. A value of 0.5 will cut the estimated level zero geometric error in half, allowing twice the screen pixels between adjacent heightmap vertices and thus rendering more quickly.
获取一个对象,该对象可用于确定此提供者提供的地形的可用性,例如点和矩形中的地形。如果可用性信息不可用,则此属性可能未定义。 Gets an object that can be used to determine availability of terrain from this provider, such as at points and in rectangles. This property may be undefined if availability information is not available.
获取此地形提供程序处于活动状态时要显示的积分。通常,这用于证明地形的来源。 Gets the credit to display when this terrain provider is active. Typically this is used to credit the source of the terrain.
获取当地形提供程序遇到异步错误时引发的事件。通过订阅该事件,您将收到错误通知,并有可能从中恢复。事件监听器传递一个实例 Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing to the event, you will be notified of the error and can potentially recover from it. Event listeners are passed an instance of TileProviderError.

readonly hasVertexNormals : boolean

获取一个值,该值指示请求的切片是否包含顶点法线。 Gets a value indicating whether or not the requested tiles include vertex normals.

readonly hasWaterMask : boolean

获取一个值,该值指示提供程序是否包含水罩。水掩模指示地球的哪些区域是水而不是陆地,因此可以将它们渲染为带有动画波浪的反射表面。 Gets a value indicating whether or not the provider includes a water mask. The water mask indicates which areas of the globe are water rather than land, so they can be rendered as a reflective surface with animated waves.
获取提供者使用的切片方案。 Gets the tiling scheme used by the provider.

方法 Methods

static Cesium.TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(ellipsoid, tileImageWidth, numberOfTilesAtLevelZero)number

当几何体来自高度图时确定适当的几何误差估计。 Determines an appropriate geometric error estimate when the geometry comes from a heightmap.
名称 Name 类型 Type 说明 Description
ellipsoid Ellipsoid 地形所附着的椭球体。 The ellipsoid to which the terrain is attached.
tileImageWidth number 与单个图块关联的高度图的宽度(以像素为单位)。 The width, in pixels, of the heightmap associated with a single tile.
numberOfTilesAtLevelZero number 瓦片级别为零时水平方向上的瓦片数量。 The number of tiles in the horizontal direction at tile level zero.
返回: Returns:
估计的几何误差。 An estimated geometric error.

static Cesium.TerrainProvider.getRegularGridIndices(width, height)Uint16Array|Uint32Array

获取表示规则网格的三角形网格的索引列表。使用相同的网格宽度和高度多次调用此函数会返回相同的索引列表。顶点总数必须小于或等于 65536。 Gets a list of indices for a triangle mesh representing a regular grid. Calling this function multiple times with the same grid width and height returns the same list of indices. The total number of vertices must be less than or equal to 65536.
名称 Name 类型 Type 说明 Description
width number 规则网格中水平方向的顶点数。 The number of vertices in the regular grid in the horizontal direction.
height number 规则网格中垂直方向的顶点数。 The number of vertices in the regular grid in the vertical direction.
返回: Returns:
索引列表。返回的 Uint16Array 为 64KB 或更少,Uint32Array 为 4GB 或更少。 The list of indices. Uint16Array gets returned for 64KB or less and Uint32Array for 4GB or less.

getLevelMaximumGeometricError(level)number

获取给定级别的图块中允许的最大几何误差。 Gets the maximum geometric error allowed in a tile at a given level.
名称 Name 类型 Type 说明 Description
level number 获得最大几何误差的图块级别。 The tile level for which to get the maximum geometric error.
返回: Returns:
最大几何误差。 The maximum geometric error.

getTileDataAvailable(x, y, level)boolean|undefined

确定图块的数据是否可供加载。 Determines whether data for a tile is available to be loaded.
名称 Name 类型 Type 说明 Description
x number 请求几何图形的图块的 X 坐标。 The X coordinate of the tile for which to request geometry.
y number 请求几何图形的图块的 Y 坐标。 The Y coordinate of the tile for which to request geometry.
level number 请求几何图形的图块的级别。 The level of the tile for which to request geometry.
返回: Returns:
如果地形提供者不支持,则未定义,否则 true 或 false。 Undefined if not supported by the terrain provider, otherwise true or false.

loadTileDataAvailability(x, y, level)undefined|Promise.<void>

确保我们加载图块的可用性数据 Makes sure we load availability data for a tile
名称 Name 类型 Type 说明 Description
x number 请求几何图形的图块的 X 坐标。 The X coordinate of the tile for which to request geometry.
y number 请求几何图形的图块的 Y 坐标。 The Y coordinate of the tile for which to request geometry.
level number 请求几何图形的图块的级别。 The level of the tile for which to request geometry.
返回: Returns:
如果不需要加载任何内容,或者在加载所有必需的图块时解析的 Promise,则为未定义 Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded

requestTileGeometry(x, y, level, request)Promise.<TerrainData>|undefined

请求给定图块的几何形状。结果必须包括地形数据,并且可以选择包括水掩模和哪些子图块可用的指示。 Requests the geometry for a given tile. The result must include terrain data and may optionally include a water mask and an indication of which child tiles are available.
名称 Name 类型 Type 说明 Description
x number 请求几何图形的图块的 X 坐标。 The X coordinate of the tile for which to request geometry.
y number 请求几何图形的图块的 Y 坐标。 The Y coordinate of the tile for which to request geometry.
level number 请求几何图形的图块的级别。 The level of the tile for which to request geometry.
request Request 可选 optional 请求对象。仅供内部使用。 The request object. Intended for internal use only.
返回: Returns:
对所要求的几何形状的承诺。如果此方法返回未定义而不是承诺,则表明已有太多请求处于待处理状态,稍后将重试该请求。 A promise for the requested geometry. If this method returns undefined instead of a promise, it is an indication that too many requests are already pending and the request will be retried later.

类型定义 Type Definitions

Cesium.TerrainProvider.ErrorEvent(err)

发生错误时调用的函数。 A function that is called when an error occurs.
this: This:
名称 Name 类型 Type 说明 Description
err TileProviderError 保存有关所发生错误的详细信息的对象。 An object holding details about the error that occurred.
需要帮助吗?获得答案的最快方法是从社区和团队那里获得答案 Need help? The fastest way to get answers is from the community and team on the Cesium Forum.