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);