CesiumTerrainProvider

new Cesium.CesiumTerrainProvider(options)

Provide terrain slices through STK terrain service or SuperMap iServer REST API.
Name Type Description
options Object Objects containing the following properties:
Name Type Default Description
url String The url of the terrain service.
proxy Proxy optional Service agent.
requestVertexNormals Boolean false optional Whether to request normals (for lighting effects), not requested by default.
requestWaterMask Boolean false optional Whether to request the water surface flag (used for water surface special effects), it is not requested by default.
ellipsoid Ellipsoid optional Ellipsoid, the default is WGS84.
credit Credit | String optional Service description information.
isSct Boolean optional Whether it is the TIN terrain service published by iServer.
isShowGlobe Boolean optional Whether to exclude invalid terrain areas, the default is true (global display).
invisibility Boolean optional Whether to enable the function of setting the terrain display and hidden, the default is false.
packingRequest PackingRequest optional Encoding method for batch requests.
Example:
var  terrainProvider = new Cesium.CesiumTerrainProvider({
	                        url : ‘http://localhost:8090/Terrain’,
		                    requestWaterMask : true,
		                    requestVertexNormals : true,
		                    isSct : true
                     });
var viewer = new Cesium.Viewer(‘cesiumContainer’,{
                  terrainProvider : terrainProvider
             });

Members

credit : Credit

Get the description information of the terrain service.

currentVersion : String

Get or set the version of terrain data currently in use. Currently only tin terrain data is supported.

customRequestHeaders : Object

Get or set a custom request header.

hasVertexNormals : Boolean

Get whether the current terrain has vertex normals. Cannot be called before CesiumTerrainProvider#readyreturns TRUE.

hasWaterMask : Boolean

Whether there is a water surface mark.

readonlyhistoryVersions : String

Get all historical version information of terrain data. Currently only tin terrain data is supported.

indexedDBSetting : Object

Get or set whether the indexedDB cache of the terrain is enabled (IE browser does not support).
Example:
//Set whether to save the terrain cache to the indexedDB database of the browser
viewer.terrainProvider.indexedDBSetting.isOpen = true

packingRequest

Encoding method for batch requests.
See:

ready : Boolean

Get whether the terrain service is ready.

readonlyreadyPromise : Promise.<Boolean>

Get the ready state promise object of the terrain service.

requestVertexNormals : Boolean

Whether to request vertex normals.

requestWaterMask : Boolean

Whether to request the water surface flag.

subdomains : String

Get or set the subdomain name. Through this interface, you can request data from the specified subdomain.

tilingScheme : GeographicTilingScheme

Get the projection object (latitude and longitude or Mercator projection) of the terrain service.

visible : Boolean

Get or set whether the terrain is visible. Using this interface, you can set the display and hide of the terrain without refreshing the earth. You need to set invisibility to true when creating CesiumTerrainProvider.

Methods

getLevelMaximumGeometricError(level)Number

Get the maximum geometric error of the level.
Name Type Description
level Number The level of tile
Returns:
Maximum geometric error.

getTileDataAvailable(x, y, level)Boolean

Get whether the tile data corresponding to x y level is available.Get whether the tile data corresponding to x y level is available.
Name Type Description
x Number x coordinate.
y Number y coordinate.
level Number The level of tile
Returns:
it's usable or not.