您好,可以根据二维里面的bounds来换算出三维里面相机对应的altitude;可以参考代码:
function _calculateAltitudeFromBounds(bounds) {
var _PI = 3.1415926;
var _earthRadius = 6378137;
var altitude = _earthRadius;
var boundsWidth = bounds._northEast.lng - bounds._southWest.lng;
//bounds._northEast.lng - bounds._southWest.lat
if(boundsWidth >= 120) {
altitude = (_earthRadius * boundsWidth) / 60 - _earthRadius;
} else if(boundsWidth != 0) {
var angle1 = (boundsWidth / 360) * _PI;
var height = Math.sin(angle1) * _earthRadius;
var a = height / Math.tan(angle1);
var b = height / Math.tan(_PI / 6);
altitude = a + b - _earthRadius;
}
return altitude;
}