viewer.zoomTo - Camera zoom problems with terrain provider assets.agi.com/stk-terrain/world

Copy and paste on Sandcastle the following code.

You can see that the viewer.zoomTo(ENTITY248) fails. The point ENTITY248 zoomed is not in the center of the view, is out of the bottom side.

If you remove the code for the activation of the terrain provider '//assets.agi.com/stk-terrain/world' the viewer.zoomTo works fine. The point is exactly in the center of the view.

WHY???
Best regard to all the great Cesium Community from Italy (Rome)!

var viewer = new Cesium.Viewer('cesiumContainer');

// ACTIVATE A PARTICULAR TERRAIN PROVIDER
var terrainProvider = new Cesium.CesiumTerrainProvider({
    url : '//assets.agi.com/stk-terrain/world',
    requestVertexNormals: true
});
viewer.terrainProvider = terrainProvider;

// ADDING A POINT
var ENTITY248 = viewer.entities.add({
  name : 'ENTITY 248',
  position : Cesium.Cartesian3.fromDegrees(-110.0, 40.0),
  point : {
    pixelSize : 10,
    color : Cesium.Color.RED,
    outlineColor : Cesium.Color.WHITE,
    outlineWidth : 2
  },
  label : {
    text : 'ENTITY 248',
    font : '12pt monospace',
    style: Cesium.LabelStyle.FILL_AND_OUTLINE,
    outlineWidth : 3,
    verticalOrigin : Cesium.VerticalOrigin.BOTTOM,
    pixelOffset : new Cesium.Cartesian2(0, -15)
  }
});
viewer.zoomTo(ENTITY248);

Hello,

The entity API currently doesn’t have support for entities on terrain. That’s why viewer.zoomTo isn’t working properly. The point is being added on the ellipsoid surface which is below the actual terrain surface and the camera can’t zoom to it without colliding with the terrain.

Until we have better support for this, you can use the Cesium.sampleTerrain function to adjust the position for the height of the terrain.

Take a look at this demo to see how to use the sampleTerrain function: http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Terrain.html&label=All

Scroll to the bottom where it says ‘Sample Everest Terrain’

Best,

Hannah