Turn of Sun Stars and atmosphere

I am new to Cesium and have just started playing with it. I was wondering how to turn of the Sun, Stars, and atmosphere in the call:

var viewer = new Cesium.Viewer(‘cesiumContainer’, {

imageryProvider : new Cesium.WebMapServiceImageryProvider({

url : ‘http://localhost:8080/geoserver/ows’,

layers: ‘r:earth’

}),

baseLayerPicker : false,

animation: false,

geocoder: false,

timeline: false

});

Thanks!

Calvin,

Add this right after you create the viewer:

var scene = viewer.scene;

scene.skyBox = scene.skyBox.destroy();

scene.skyAtmosphere = scene.skyAtmosphere.destroy();

scene.sun = scene.sun.destroy();

Patrick

Don’t forget the moon.

scene.moon = scene.moon.destroy();

Instead of destroying after creating the viewer, set false calling the constructor:

window.viewer = new Cesium.Viewer('cesiumContainer', { baseLayer: Cesium.ImageryLayer.fromProviderAsync( Cesium.TileMapServiceImageryProvider.fromUrl( Cesium.buildModuleUrl("Assets/Textures/NaturalEarthII"), ), ), animation: false, timeline: false, geocoder: false, skyBox: false, skyatmosphere: false, sun: false, moon: false, });