设置
/* 注意 enableCollisionDetection 和 enableZoom 必须是 true 才有效 */
// 最近视距,默认值 1,单位为米
viewer.scene.screenSpaceCameraController.minimumZoomDistance = 1;
// 最远视距,默认值正无穷大 Number.POSITIVE_INFINITY
viewer.scene.screenSpaceCameraController.maximumZoomDistance = Number.POSITIVE_INFINITY;
参数说明
minimumZoomDistance
最近视距,默认值为 1,单位为米。
maximumZoomDistance
最远视距,默认值为正无穷大,单位为米。
enableCollisionDetection
enableZoom
效果
最近视距设置成 7 * 10 ^ 5
,就不再往下走: