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

Method add

src/common/commontypes/Bounds.js:300–306  ·  view source on GitHub ↗

* @function Bounds.prototype.add * @description 在当前的 Bounds 上按照传入的坐标点进行平移,返回新的范围。 * @example * var bounds1 = new Bounds(-50,-50,40,40); * //bounds2 是新的 bounds * var bounds2 = bounds.add(20,10); * @param {number} x - 坐标点的 x 坐标。 * @param {number} y - 坐标点的 y 坐标。

(x, y)

Source from the content-addressed store, hash-verified

298 * @returns {Bounds} 新的 bounds,此 bounds 的坐标是由传入的 x,y 参数与当前 bounds 坐标计算所得。
299 */
300 add(x, y) {
301 if ((x == null) || (y == null)) {
302 throw new TypeError('Bounds.add cannot receive null values');
303 }
304 return new Bounds(this.left + x, this.bottom + y,
305 this.right + x, this.top + y);
306 }
307
308 /**
309 * @function Bounds.prototype.extend

Callers 2

intersectsBoundsMethod · 0.45
wrapDateLineMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected