Despite researching all the previous posts on properly configuring CesiumTerrainProvider I have still not been able to visualize my .terrain tiles constructed by cesium terrain builder.
I’m trying to host both Cesium and terrain on a local server using “python -m SimpleHTTPServer 8000”
I am receiving the errors “Failed to obtain terrain tile X: 1 Y: 0 Level: 0” and “Failed to obtain terrain tile X: 0 Y: 0 Level: 0”. I made sure to include the empty .terrain tiles 0/0/0.terrain, 0/1/0.terrain, and the layer.json properly.
The server feed acknowledges that the get request to the layer.json and .terrain files were successful:
I’m assuming this is an issue with CORS. I’ve attempted the suggestion of using a proxy ie. DefaultProxy(’/proxy/’) within the CesiumTerrainProvider and was receiving “message File not found” (404). Maybe I was mistaken in using ‘/proxy/’ verbatim and it really is pseudocode for an appropriate proxy url? Either way, I lack knowledge on how servers work and need help with these last few steps.
I’d really appreciate any suggestions to make the terrain visible,
Thanks!
If you are using two separate instances of “python -m SimpleHTTPServer 8000”, there are several problems.
Are you using the same port for both? Because that won’t work.
If you are using different ports, then both will work but CORS is definitely an issue.
The sample proxy code is meant to work with the development Node.js server that ships with Cesium, so if you are using a different server (which you are) you need to supply your own proxy.
An easy way to get things working is to temporarily move all of your terrain into a sub-directory of your client code and serve them both out of 1 server. This will eliminate the CORS issue and make sure everything works before tackling the CORS issue.
It looks like the application isn’t able to access the server. The first thing I would try is to remove the proxy. Other than that, I’m not really sure how to troubleshoot other than to double check that your URI to the server and your token are correct.
If that doesn’t work, are there any other error messages that appear in the console?
They are all open and free to use. I’ve wanted to understand how “Cesium.ArcGisImageServerTerrainProvider” works. After that, I want to serve my own image services.
But I got the same error every time. (I’ve tried every version of this code, this time “token” is passive, I know that)
var viewer = new Cesium.Viewer(‘cesiumContainer’);
var terrainProvider = new Cesium.ArcGisImageServerTerrainProvider({