Cesium Note11:获取当前层级

Cesium Note11:获取当前层级

// 获取当前层级 function heightToZoom(height){ var A = 40487.57; var B = 0.00007096758; var C = 91610.74; var D = -40467.74; return Math.round(D+(A-D)/(1+Math.pow(height/C, B))); } var height = Math.ceil(viewer.camera.positionCartographic.height); var zoom = heightToZoom(height); console.log(zoom,'zoom');