I run following code in the Sandbox:
require([‘Cesium’], function(Cesium)
{
“use
strict”;
var gallery =
‘…/…/CesiumViewer/Gallery/’;
function
createButtons() {
var toolbar = document.getElementById(‘toolbar’);
var button = document.createElement('button');
button.className = ‘cesium-button’;
button.onclick = function() {
viewer.centralBody.enableLighting = true;
//centralBody.enableLighting = true;
};
button.textContent = ‘Show Lighting’;
toolbar.appendChild(button);
button = document.createElement(‘button’);
button.className = ‘cesium-button’;
button.onclick = function() {
viewer.centralBody.enableLighting = false;
//centralBody.enableLighting = false;
};
button.textContent = ‘Hide Lighting’;
toolbar.appendChild(button);
button = document.createElement(‘button’);
button.className = ‘cesium-button’;
button.onclick = function() {
viewer.centralBody.enableLighting = null;
};
button.textContent = ‘Hide Lighting (null)’;
toolbar.appendChild(button);
}
var viewer =
new Cesium.Viewer(‘cesiumContainer’);
viewer.extend(Cesium.viewerDynamicObjectMixin);
createButtons();
var scene =
viewer.scene;
var centralBody
= scene.getPrimitives().getCentralBody();
Sandcastle.finishedLoading();
});
Setting
“enableLighting” to false does not do anything. I had to set it to null in order
to turn the option off.
Ismir