1. A concise explanation of the problem you’re experiencing.
I am attempting to sample terrain heights at specific positions. I am currently testing this feature with some coordinates around Mount Everest and NYC and I am receiving only zeros.
2. A minimal code example. If you’ve found a bug, this helps us reproduce and repair it.
var terrainProvider = Cesium.createWorldTerrain();
var positions = [
Cesium.Cartographic.fromDegrees(86.925145, 27.988257),
Cesium.Cartographic.fromDegrees(87.0, 28.0)
];
var promise = Cesium.sampleTerrainMostDetailed(terrainProvider, positions);
Cesium.when(promise, function(updatedPositions) {
// positions[0].height and positions[1].height have been updated.
// updatedPositions is just a reference to positions.
});
console.log(positions[0].height);
console.log(positions[1].height);
3. Context. Why do you need to do this? We might know a better way to accomplish your goal.
I am wanting to create a terrain profile graph based off of coordinates or potential a user drawn poly-line.
Similar to these examples: https://www.bluemarblegeo.com/knowledgebase/global-mapper-19/Path_Profile/PathProfile_3DCutaway.htm
4. The Cesium version you’re using, your operating system and browser.
Newest Cesium, Google Chrome