fromUrl

suspend fun fromUrl(url: Any, options: CesiumTerrainProvider.ConstructorOptions? = definedExternally): CesiumTerrainProvider(source)

Creates 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.fromUrl(
IonResource.fromAssetId(3956), {
requestVertexNormals: true
})
});
} catch (error) {
console.log(error);
}

Parameters

url

The URL of the Cesium terrain server.

options

An object describing initialization options.

See also