fromIonAssetId

suspend fun fromIonAssetId(assetId: Int, options: CesiumTerrainProvider.ConstructorOptions? = definedExternally): CesiumTerrainProvider(source)

Creates a TerrainProvider from a Cesium ion asset ID 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

assetId

The Cesium ion asset id.

options

An object describing initialization options.

See also