MCPcopy Index your code
hub / github.com/SuperMap/iClient-JavaScript / resolutionToScale

Function resolutionToScale

src/openlayers/core/Util.js:102–108  ·  view source on GitHub ↗

* @function Util.resolutionToScale * @description 通过分辨率计算比例尺。 * @param {number} resolution - 分辨率。 * @param {number} dpi - 屏幕分辨率。 * @param {string} mapUnit - 地图单位。 * @returns {number} 比例尺。 * @private

(resolution, dpi, mapUnit)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

getMeterPerMapUnitFunction · 0.90

Tested by

no test coverage detected