How to get terrain height from TerrainProvider


With Cesium 1.33,
I'd like to get terrain height of the point(longitude, latitude) from CesiumTerrainProvider.

I try to write a program but it does not work.
The program is as follows:

Hi there,

Take a look at sampleTerrainMostDetailed (

That should be easier – hope it helps!

  • Rachel

Thank you very much for your helps.

I revised my program.
However, The results do not change.

Hi there,

I don’t see anything wrong with your code as posted when I tried it locally – are you sure that your number is the expected result? If your reference data is from elsewhere, it’s possible that the terrain datasets report different numbers because they’re sampled at different resolutions, for instance.

If you’re getting any errors, try running this and let us know what the console says:


  • Rachel