Reputation: 3854
I want to fix the minimum size of 3D globe such as if user decreases the size through mouse it should not decrease beyond some fixed value.
var viewer = new Cesium.Viewer("cesiumContainer", {
animation: false,
timeline: false
});
Any help is highly appreciated, Thanks
Upvotes: 1
Views: 241
Reputation: 12418
Give this a try:
var viewer = new Cesium.Viewer("cesiumContainer"); // plus whatever options
viewer.scene.screenSpaceCameraController.maximumZoomDistance = 1e8;
The value 1e8
here is the maximum number of meters that the camera is allowed to travel away from the focus point (typically the center of the Earth). You can try 1e7
or 1e9
to adjust it.
Upvotes: 0
Reputation: 1092
viewer.scene.screenSpaceCameraController.minimumZoomDistance = 6378137;
viewer.scene.screenSpaceCameraController.maximumZoomDistance = 6378137 * 2;
Upvotes: 1