How to switch to Cesium World Terrain in WebGLEarth?

We have a project that uses WebGLEarth which it looks like internally uses Cesium. by default, they were setup to use the STK Terrain which now no longer works. Is there an easy way to switch to using the new terrain service without needing to do a code change in WebGLEarth itself?

This is the code:

I note that we can easily provide the terrain param a full URL to a tile server. Is there a way to do that for ceisum terrain rather than having to mod WebGLEarth to call Cesium.createWorldTerrain()?


I would open an issue on their GitHub repo to make this change so it works for everyone.

I don’t know how WebGLEarth exposes the Cesium library, but if you can initialize WebGLEarth without terrain, and get access to the viewer object, you can then just do:

Cesium.Ion.defaultAccessToken = ‘’;

viewer.terrainProvider = new Cesium.CesiumTerrainProvider({

url : Cesium.IonResource.fromAssetId(1) // Cesium World Terrain



To set your ion token and get Cesium World Terrain.

Hi Omar Shehata,

We have a version of cesium 1.34. Do need to change to version 1.43 to use your solution Omar?

Thank you!

Yeah, Cesium 1.34 is a pretty old version at this point. I think ion was added in version 1.45:

Thank you!!