How to prevent camera tilt/rotation?

Skip to first unread message

Aug 25, 2019, 9:45:54 PM8/25/19
to cesium-dev
1. A concise explanation of the problem you're experiencing.
I am unable to find a way to prevent the camera from tilting or rotating when using the map in the 'globe' view. When viewing a flat map there is no problem, but using the flat map is not an option for my application.

2. A minimal code example. If you've found a bug, this helps us reproduce and repair it.
I've attempted to constrain the axis using :
camera.constrainedAxis = Cesium.Cartesian3.UNIT_Z;
but there is no disernable change. 
I've also attempted to set defaultLookAmount and defaultRotateAmount to 0 and that has no impact on behaviour of the camera.

3. Context. Why do you need to do this? We might know a better way to accomplish your goal.

The look and rotate are unnessesary for my application, and make navigating/zooming on mobile nearly impossible. The globe constantly turns and tilts, often resulting in a misconfigured map that needs to be refreshed to return to home.

4. The Cesium version you're using, your operating system and browser.
Currently using 1.6, Kubuntu and Firefox, but this issue is common to all major OS and browsers.

Omar Shehata

Aug 26, 2019, 2:14:06 PM8/26/19
to cesium-dev
Hey Stephen,

Have you tried disabling tilt on the camera controller?

viewer.scene.screenSpaceCameraController.enableTilt = false;

There's a few other options you can disable there too. This camera code example disables all camera movement and overrides it with keyboard controls (for your case it would be a good reference just to see how to disable the various interactions):

You may also want to override the home button to go to a view/with your custom logic, that way the user doesn't have to refresh to get back to some home state in your application:

viewer.homeButton.viewModel.command.beforeExecute.addEventListener(function (e) {
    e.cancel = true;
    // Add any custom code here, such as flying to some saved view.

Let me know if this helps!

Stephen Haynes

Aug 26, 2019, 7:44:56 PM8/26/19
That worked! Thanks Omar!



You received this message because you are subscribed to a topic in the Google Groups "cesium-dev" group.
To unsubscribe from this topic, visit
To unsubscribe from this group and all its topics, send an email to
To view this discussion on the web visit

Apr 2, 2020, 7:50:13 AM4/2/20
to cesium-dev
Thanks Omar!!
Reply all
Reply to author
0 new messages