Hi,
Below code doesn’t display the default cesium globe
function startup(Cesium) {
'use strict';
//Sandcastle_Begin
//Load a GeoJSON file containing simplestyle information.
//To learn more about simplestyle, see https://github.com/mapbox/simplestyle-spec
//In this particular example, the name of each entity is set to its maki icon identifier.
//Clicking on each billboard will show it's identifier in the InfoBox.
var terrain = Cesium.createDefaultTerrainProviderViewModels();
var viewer = new Cesium.Viewer('cesiumContainer', {
terrainProviderViewModels: terrain,
selectedTerrainProviderViewModel: terrain[1],
timeline: false,
animation : false,
vrButton : true,
selectionIndicator : false
});
When i run my file, its just a black background. Why is it so?
Hello,
The globe isn’t rendering because you are adding terrain incorrectly. Please see this demo for how to add terrain: http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Terrain.html&label=All
Best,
Hannah
Well, i had changed my function as below
function startup(Cesium) {
‘use strict’;
//Sandcastle_Begin
var viewer = new Cesium.Viewer(‘cesiumContainer’,
{
infoBox : false,
selectionIndicator : false,
shadows : true
});
//Sandcastle_End
Sandcastle.finishedLoading();
}
if (typeof Cesium !== “undefined”) {
startup(Cesium);
} else if (typeof require === “function”) {
require([“Cesium”], startup);
}
When i run the above code, its displaying as shown in the snapshot