Terrain from TMS (readyMap) server?

Hi, I'm trying to test out Cesium with our existing terrain server, which is a readyMap server. I modified the "Hello World" example but it appears to still be using Bing maps. Can anyone tell me what's wrong? The only change from the hello world example is at the bottom to use our server. I know the address is right because when I put the URL into a web browser I get a response from the TMS telling me it has tile sets for the elevation data.

<!DOCTYPE html>
<html lang="en">
<head>
  <title>Hello World!</title>
  <script src="Cesium/Cesium.js"></script>
  <style>
      @import url(Cesium/Widgets/CesiumWidget/CesiumWidget.css);

      #cesiumContainer {
          position: absolute;
          top: 0;
          left: 0;
          height: 100%;
          width: 100%;
          margin: 0;
          overflow: hidden;
          padding: 0;
          font-family: sans-serif;
      }

      body {
          padding: 0;
          margin: 0;
          overflow: hidden;
      }
  </style>
</head>
<body>
  <div id="cesiumContainer"></div>
  <script>
    var widget = new Cesium.CesiumWidget('cesiumContainer');
    var terrainProvider = new VRTheWorldTerrainProvider({
         url : 'http://<IP address removed>/readymap/tiles/1.0.0/8/',
         credit : 'Our data provided'
    });
    widget.centralBody.terrainProvider = terrainProvider;
  </script>
</body>
</html>

Hi,

Changing the terrain provider won’t change the base layer, and the base layer for the Cesium widget is Bing by default. I’m not entirely sure if you can (or would) have a terrain layer on without an overlay layer - but if you desperately want to you could try changing the terrain sandcastle and taking out all the other layers and adding your terrain.

http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Terrain.html&label=Showcases

If you are seeing terrain in your globe (under the Bing imagery layer), then I believe you have succeeded. (Provided you are zooming to the location where your terrain is).

Toby

Cesium separates terrain (surface shape) from imagery (the coloring of the surface). TerrainProviders like VRTheWorldTerrainProvider only impact terrain, not imagery. As Toby mentioned, if you want to also load the imagery from a VRTheWorld server, you should create and install an imagery provider as well. I think VRTheWorld can be accessed with a TileMapServiceImageryProvider, but I’m not 100% sure. Let me know if that doesn’t work for you. Maybe someone from VT MAK can jump in and confirm as well.

Kevin

Thanks, I forgot about the imagery layer on top of the terrain. I am setting this up on a local network where it does not have internet access. I will try adding an imagery layer to Cesium.

So here's my current try, which does not work. From the documentation it looks like there are a couple of ways to specify the terrain and imagery but I grabbed this from one of the tutorials. Note: the web page is hosted on an Apache machine with IP address 192.168.1.23 which also has the readyMap server. I've double-checked that the tiles '8' and '4' are the terrain and imagery.

<body>
  <div id=“cesiumContainer”></div>
  <script>
    var widget = new Cesium.CesiumWidget(‘cesiumContainer’);
    var terrainProvider = new VRTheWorldTerrainProvider({
         url : ‘http://192.168.1.23/readymap/tiles/1.0.0/8/’,
         credit : ‘our elevation data’
    });
    widget.centralBody.terrainProvider = terrainProvider;

    var layers = widget.centralBody.getImageryLayers();
    var imagery = layers.addImageryProvider(new Cesium.TileMapServiceImageryProvider({
         url : ‘http://192.168.1.23/readymap/tiles/1.0.0/4/’,
         maximumlevel : 8,
         credit : ‘our imagery’
    }));
  </script>
</body>

Any errors in the console? Is the server hosting the web page running on port 80 as well? If not, you’ll need to make sure your readyMap server allows CORS access, or use a proxy.

Also, with this code, the Bing layer will remain active underneath your layer. You should remove it by executing:

layers.removeAll();

before adding your imagery layer.

Kevin

Thanks for the suggestions. I tried just using the imagery layer and was able to get that to work. The terrain part is still having troubles though. I'll see if I can get the error text out of Firebug and make sense of it.