* @function Util.resolutionToScale * @description 通过分辨率计算比例尺。 * @param {number} resolution - 分辨率。 * @param {number} dpi - 屏幕分辨率。 * @param {string} mapUnit - 地图单位。 * @returns {number} 比例尺。 * @private
(resolution, dpi, mapUnit)
| 100 | * @private |
| 101 | */ |
| 102 | resolutionToScale(resolution, dpi, mapUnit) { |
| 103 | const inchPerMeter = 1 / 0.0254; |
| 104 | // 地球半径。 |
| 105 | const meterPerMapUnit = getMeterPerMapUnit(mapUnit); |
| 106 | const scale = 1 / (resolution * dpi * inchPerMeter * meterPerMapUnit); |
| 107 | return scale; |
| 108 | }, |
| 109 | |
| 110 | /** |
| 111 | * @function Util.toSuperMapBounds |
nothing calls this directly
no test coverage detected