MCPcopy Create free account
hub / github.com/SuperMap/iClient-JavaScript / getScaleFromRes

Method getScaleFromRes

src/openlayers/mapping/WebMap.js:518–523  ·  view source on GitHub ↗

* @private * @function WebMap.prototype.getScaleFromRes * @description 将分辨率转换为比例尺 * @param {number} resolution - 分辨率 * @param {string} coordUnit - 比例尺单位 * @param {number} dpi

(resolution, coordUnit = 'DEGREE', dpi = 96)

Source from the content-addressed store, hash-verified

516 * @param {number} dpi
517 */
518 getScaleFromRes(resolution, coordUnit = 'DEGREE', dpi = 96) {
519 let scale,
520 mpu = metersPerUnit[coordUnit.toUpperCase()];
521 scale = (resolution * dpi * mpu) / 0.0254;
522 return '1:' + scale;
523 }
524 /**
525 * @private
526 * @function WebMap.prototype.formatScale

Callers 1

getScalesMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected