How to only rotate the globe?

Hi all,

Is there a way for me to auto-rotate the globe?
Previously, I found this few lines of codes in this thread, I think, and tested it out:

var lastNow =;
viewer.clock.onTick.addEventListener(function(clock) {
    var now =;
    var spinRate = 0.08;
    var delta = (now - lastNow) / 1000;
    lastNow = now;, -spinRate * delta);

So with these lines of codes, the globe/camera (i'm not sure which) was able to rotate on its own. However as I changed the view to either 2D Map or 2.5D Columbus View, they will rotate as well.

Therefore my question is, how do I only make the 3D globe rotate?

Appreciate any help!



You could check the scene.mode ( in your event handler and only rotate when the mode is 3D.
You probably also need to reset e.g. lastNow to avoid sudden jumps when going back to 3D.

I did not see an event for a scene.mode change.


Hello Alan,

Take a look at the ‘View in ICRF’ example in this demo:

Is that what you’re looking for?