CesiumTerrainProvider
A TerrainProvider that accesses terrain data in a Cesium terrain format. Terrain formats can be one of the following:
https://github.com/AnalyticalGraphicsInc/quantized-mesh Quantized Mesh
https://github.com/AnalyticalGraphicsInc/cesium/wiki/heightmap-1.0 Height Map
// Create Arctic DEM terrain with normals.
try {
const viewer = new Viewer("cesiumContainer", {
terrainProvider: await CesiumTerrainProvider.fromIonAssetId(3956, {
requestVertexNormals: true
})
});
} catch (error) {
console.log(error);
}
Parameters
An object describing initialization options
See also
Types
Initialization options for the CesiumTerrainProvider constructor
Properties
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. Note that this reflects tiles that are known to be available currently. Additional tiles may be discovered to be available in the future, e.g. if availability information exists deeper in the tree rather than it all being discoverable at the root. However, a tile that is available now will not become unavailable in the future.
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.
Gets a value indicating whether or not the requested tiles include metadata.
Gets a value indicating whether or not the requested tiles include vertex normals.
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.
Boolean flag that indicates if the client should request metadata from the server. Metadata is appended to the standard tile mesh data only if the client requests the metadata and if the server provides a metadata.
Boolean flag that indicates if the client should request vertex normals from the server. Vertex normals data is appended to the standard tile mesh data only if the client requests the vertex normals and if the server provides vertex normals.
Boolean flag that indicates if the client should request a watermask from the server. Watermask data is appended to the standard tile mesh data only if the client requests the watermask and if the server provides a watermask.
Gets the tiling scheme used by this provider.
Functions
Gets the maximum geometric error allowed in a tile at a given level.
Determines whether data for a tile is available to be loaded.
Makes sure we load availability data for a tile
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.
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.