I am trying to find an easy way of setting the initial scene zoom.
The default one is out of the bounds i need, and since there is no such field in Viewer constructor, i am trying to zoom into my desired altitude with Camera.zoomIn() after cesium init, but it only takes “amount” as parameter.
I tried and tried to somehow define by experimenting how does that “amount” relate to the minimum or maximumZoomDistance i am setting on ScreenSpaceCameraController but failed to find the connection.
All after all, this is what is happening:
screenSpaceCameraController.maximumZoomDistance = 15000000
screenSpaceCameraController.minimumZoomDistance = 1500000
Pages load, and the globe is further than maximZoomDistance.
Mousewheel zoomOut, and the globe zoomsIn, it jumps into the proper maximumZoomDistance now
From now on zoom with wheel seems to be working correctly, but
doing camera.zoomOut() and camera.zoomIn() (like on plus button click) ignores maximum and minimumZoomDistance, and can zoom out of those bounds.
Why do the zoomIn and zoomOut don’t care abot that m…ZoomDistance, how do i set the initial altitude level, and what is “amount”? Is it messured in meters? Is it mesured in liters? Is it a type-o and should spell “almond”?
A delicious, moist cake for any helpful post.