new TerrainProvider()
Provide terrain or other geometric shapes for the surface of ellipsoids. According to the TilingScheme, the surface geometry is organized into a pyramid composed of tiles.
Members
-
static heightmapTerrainQualityNumber
-
Specify the quality of the terrain created from the altitude map. A value of 1.0 will ensure that the distance between adjacent vertices in the height map does not exceed Globe. Screen pixels may be very slow. A value of 0.5 will reduce the estimated zero order geometric error by half, allowing for a doubling of screen pixels between adjacent height map vertices for faster rendering.
-
availabilityTileAvailability
-
Get an object that can be used to determine the availability of terrain from this provider, such as in points and rectangles. This function should not be called before TerrainProvider # ready returns true. If available, this attribute may not be defined and there may be no relevant information.
-
creditCredit
-
Obtain the copyright statement to be displayed when this terrain provider is active. Usually, this is the terrain source used for credit. This function should not be called before TerrainProvider # ready returns true.
-
errorEventEvent
-
The event triggered when the terrain provider encounters an asynchronous error. By subscribing to events, you will receive error notifications and may potentially recover from them. The event listener is passed an instance of TileProviderError.
-
hasVertexNormalsBoolean
-
Get a value indicating whether the requested tile contains vertex normals. This function should not be called before TerrainProvider # ready returns true.
-
hasWaterMaskBoolean
-
Get a value indicating whether the Provider contains water surface mask data. The water surface mask indicates which areas on Earth are water rather than land, so they can appear as reflective surfaces with animated waves. This function should not be called before TerrainProvider # ready returns true.
-
readyBoolean
-
Get a value indicating whether the Provider is ready to use.
-
readonly readyPromisePromise.<Boolean>
-
Get a Promise that parses to true when the Provider is ready to use.
-
tilingSchemeTilingScheme
-
Obtain the slicing scheme used by the provider. This function should not be called before TerrainProvider # ready returns true.
Methods
-
static getEstimatedLevelZeroGeometricErrorForAHeightmap(ellipsoid, tileImageWidth, numberOfTilesAtLevelZero){Number}
-
Determine appropriate geometric error estimates when the geometry comes from a height map.
Name Type Description ellipsoidEllipsoid The ellipsoid to which the terrain is attached.
tileImageWidthNumber The width (in pixels) of the height map associated with a single tile.
numberOfTilesAtLevelZeroNumber The number of tiles at level 0 in the horizontal direction.
Returns:
Type Description Number Estimated geometric error. -
static getRegularGridIndices(width, height){Uint16Array}
-
Retrieve the index list of triangular meshes representing regular meshes. Call this function multiple times to return the same index list using the same grid width and height. The total number of vertices must be less than or equal to 65536.
Name Type Description widthNumber The number of horizontal vertices in a regular grid.
heightNumber The number of vertices in the vertical direction in a regular grid.
Returns:
Type Description Uint16Array Index list. -
getLevelMaximumGeometricError(level){Number}
-
Obtain the maximum geometric error allowed in tiles of a given level. This function should not be called before TerrainProvider # ready returns true.
Name Type Description levelNumber To obtain the tile level with the maximum geometric error.
Returns:
Type Description Number Maximum geometric error. -
getTileDataAvailable(x, y, level){Boolean}
-
Determine if data for tiles can be loaded.
Name Type Description xNumber Request the X coordinate of the tile of the geometry.
yNumber Request the y-coordinate of the tile of the geometry.
levelNumber Request the level of tiles.
Returns:
Type Description Boolean If the terrain provider does not support it, it is undefined; otherwise, it is true or false. -
requestTileGeometry(x, y, level, request){Promise.<TerrainData>|undefined}
-
Request the geometry of the given tile. This function should not have been called before and TerrainProvider # ready returns true. The result must include terrain data and optionally a water area mask and indicate which sub tiles are available.
Name Type Description xNumber Request the X coordinate of the tile of the geometry.
yNumber Request the Y coordinate of the tile of the geometry.
levelNumber Request the tile level of the geometry.
requestRequest optional Request object. For internal use only.
Returns:
Type Description Promise.<TerrainData> | undefined Promise for the requested geometry. If this method returns undefined instead of a promise, it indicates that there are already too many requests pending and the request will be retried later.