I have a typical spin globe function to rotate the globe on page load like so:
function spinGlobe( dynamicRate ){
var previousTime = Date.now();
this.viewer.scene.postRender.addEventListener(spinning = function (scene, time){
var spinRate = dynamicRate;
var currentTime = Date.now();
var delta = ( currentTime - previousTime ) / 1000;
previousTime = currentTime;
this.viewer.scene.camera.rotate(Cesium.Cartesian3.UNIT_Z, -spinRate * delta);
});
}
spinGlobe(0.02);
Is there a zoom in/out event that can be used to stop the globe spinning when the user zooms in or out?
I tried something based on a change in camera height, however camera height naturally changes a small amount as the globe rotates.