UNPKG

@vtx/cs-map

Version:

React components for Vortex

22 lines (18 loc) 634 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.zoomToHeight = exports.heightToZoom = void 0; var A = 40487.57; var B = 0.00007096758; var C = 91610.74; var D = -40467.74; // 根据camera高度近似计算当前层级 var heightToZoom = exports.heightToZoom = function heightToZoom(height) { return Math.round(D + (A - D) / (1 + Math.pow(height / C, B))); }; // 根据当前层级近似计算camera高度 var zoomToHeight = exports.zoomToHeight = function zoomToHeight(zoom) { return Math.round(C * Math.pow((A - D) / (zoom - D) - 1, 1 / B)); }; //# sourceMappingURL=heightAndZoom.js.map