sampleTerrainMostDetailed

Initiates a sampleTerrain() request at the maximum available tile level for a terrain dataset.
Example:
// Query the terrain height of two Cartographic positions
const terrainProvider = await Cesium.createWorldTerrainAsync();
const positions = [
    Cesium.Cartographic.fromDegrees(86.925145, 27.988257),
    Cesium.Cartographic.fromDegrees(87.0, 28.0)
];
const updatedPositions = await Cesium.sampleTerrainMostDetailed(terrainProvider, positions);
// positions[0].height and positions[1].height have been updated.
// updatedPositions is just a reference to positions.

// To handle tile errors, pass true for the rejectOnTileFail parameter.
try {
   const updatedPositions = await Cesium.sampleTerrainMostDetailed(terrainProvider, positions, true);
} catch (error) {
  // A tile request error occurred.
}
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.