CesiumJS cannot load terrain from CDN

I’ve placed a terrain folder in my CDN and am trying to load it in CesiumJS. I put the correct URL and can see Cesium successfully accessing the files in the chrome network panel: layer.json, 0/0/0.terrain, 0/1/0.terrain without error. Still, the terrain does not show up. I see a transparent globe. There are no errors in the browser console. The setup code is simply:

new Cesium.CesiumTerrainProvider({ url: terrainProviderUrl })

Any ideas how to debug this?
Note: I know you don’t support it, but the terrain loads fine using cesium-terrain-server…

I found the cause: apparently the tiles are gzipped, and the CDN needs to be configured to send “content-encoding: gzip” for any tile file. Once that’s done, everything works.

1 Like