1. A concise explanation of the problem you're experiencing.
Unable to retrieve terrain height at a position using sampleTerrain. May be unsupported? Looking for a work around.
2. A minimal code example. If you've found a bug, this helps us reproduce and repair it.
Paste into sandcastle
var viewer = new Cesium.Viewer('cesiumContainer', {
});
var terrainProvider = new Cesium.ArcGISTiledElevationTerrainProvider({
url: ‘https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer’
});
terrainProvider.readyPromise.then(function(isReady){
console.log('Ready:'+isReady);
viewer.terrainProvider = terrainProvider;
var samplePos = [
Cesium.Cartographic.fromDegrees(-77.134487059577509, 38.6777220281884)
];
var promise = Cesium.sampleTerrain(viewer.terrainProvider, 15, samplePos);
promise.then(function(promise){
console.log('Latitude:' + Cesium.Math.toDegrees(samplePos[0].latitude));
console.log('Longitude:' + Cesium.Math.toDegrees(samplePos[0].longitude));
console.log('Height:' + samplePos[0].height);
});
});
3. Context. Why do you need to do this? We might know a better way to accomplish your goal.
Need to gather terrain heights at specific locations. Workarounds are acceptable
4. The Cesium version you're using, your operating system and browser.
1.59
Sandcastle ArcGIS Tiled Elevation Terrain Example