zoom level depends on viewport size?

hi,

when I resize my browser window from big to narrow, the (tile) zoom level changes, but the camera height remains the same. — is there any way to prevent this from happening?

screen capture: https://vid.me/bZLk

Hi there,

I don’t see the zoom level (using web map terminology: https://www.mapbox.com/help/how-web-maps-work/) changing in this example.

In summary, Cesium is choosing the optimal tile zoom level based on camera position, canvas resolution and some error tolerance (how much does the current view deviate from a platonic view?). This is just a fundamental part of how tiled maps work, however Cesium allows you to specify the maximum error tolerance for what is considered “optimal”. The higher the value, the greater the tolerable error. By default, this value is 2.0 (because it uses less bandwidth). I would recommend lowering it to 1.5 which will use more bandwidth but should fix this use case unless you are right at a zoom level boundary. Here’s the doc for maximumScreenSpaceError: https://cesiumjs.org/Cesium/Build/Documentation/Globe.html#maximumScreenSpaceError you would access via scene.globe.maximumScreenSpaceError. In short, playing with screen space error should allow you to tune your image quality and behavior when the canvas is resized.

Best,

  • Rachel