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

Method scale

src/openlayers/overlay/theme/Theme.js:522–526  ·  view source on GitHub ↗

* @function Theme.prototype.scale * @description 获取某像素坐标点 pixelP 相对于中心 center 进行缩放 scaleRatio 倍后的像素点坐标。 * @param {Object} pixelP - 像素点。 * @param {Object} center - 中心点。 * @param {number} scaleRatio - 缩放倍数。 * @returns {Array. } 返回数组型比例。

(pixelP, center, scaleRatio)

Source from the content-addressed store, hash-verified

520 * @returns {Array.<number>} 返回数组型比例。
521 */
522 scale(pixelP, center, scaleRatio) {
523 var x = (pixelP[0] - center[0]) * scaleRatio + center[0];
524 var y = (pixelP[1] - center[1]) * scaleRatio + center[1];
525 return [x, y];
526 }
527
528 /**
529 * @function Theme.prototype.toiClientFeature

Callers 3

fireMethod · 0.95
getLocalXYMethod · 0.95
constructorMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected