maximumZoomDistance not working in 2D

1. A concise explanation of the problem you’re experiencing.

screenSpaceCameraController.maximumZoomDistance does not seem to work in 2D. When I go to 2d it seems to limit the camera height to around 40,000 km regardless of screen size. Worse yet, if I programatically zoom out farther, for example camera.flyHome() with some default rectangle, as soon as the user tries to zoom in or out it will snap back to that 40,000km distance

2. A minimal code example. If you’ve found a bug, this helps us reproduce and repair it.

var viewer = new Cesium.Viewer(‘cesiumContainer’);

viewer.scene.screenSpaceCameraController.maximumZoomDistance = 60000000;

Cesium.Camera.DEFAULT_VIEW_RECTANGLE = Cesium.Rectangle.fromDegrees(-80,-90,100,90);




Sandcastle Link

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

I am trying to control limits of zooming and panning in 2D. I would like to set the max zoom distance in 2D to be the width of the earth. Setting DEFAULT_VIEW_RECTANGLE works to zoom to map height but not width.

4. The Cesium version you’re using, your operating system and browser.

Cesium v1.61

Chrome Version 77.0.3865.90 (Official Build) (64-bit)

Windows 10 64-bit

Updated SandCastle link with mapProjection set to Mercator. It seems the issue that I’m describing happens when home button is clicked in 2D and then user tries to zoom out for example.