fromWorldBathymetry
fun fromWorldBathymetry(options: Terrain.Companion.FromWorldBathymetryOptions? = definedExternally): Terrain(source)
Creates a Terrain instance for Cesium World Bathymetry.
// Create Cesium World Bathymetry with default settings
const viewer = new Viewer("cesiumContainer", {
terrain: fromWorldBathymetry)
});
Content copied to clipboard
// Create Cesium World Terrain with normals.
const viewer1 = new Viewer("cesiumContainer", {
terrain: fromWorldBathymetry({
requestVertexNormals: true
});
});
Content copied to clipboard
// Handle loading events
const bathymetry = Terrain.fromWorldBathymetry();
scene.setTerrain(bathymetry);
bathymetry.readyEvent.addEventListener(provider => {
scene.globe.enableLighting = true;
bathymetry.provider.errorEvent.addEventListener(error => {
alert(`Encountered an error while loading bathymetric terrain tiles! ${error}`);
});
});
bathymetry.errorEvent.addEventListener(error => {
alert(`Encountered an error while creating bathymetric terrain! ${error}`);
});
Content copied to clipboard
Return
An asynchronous helper object for a CesiumTerrainProvider