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

Method determineQuadrant

src/common/commontypes/Bounds.js:571–580  ·  view source on GitHub ↗

* @function Bounds.prototype.determineQuadrant * @description 判断传入坐标是否在 bounds 范围内的象限。以 bounds 中心点为坐标原点。 * @example * var bounds = new Bounds(-180,-90,100,80); * //str = "tr"; * var str = bounds.determineQuadrant( * new LonLat(20,20) * ); * @param {LonLa

(lonlat)

Source from the content-addressed store, hash-verified

569 * @returns {string} 传入坐标所在的象限("br" "tr" "tl" "bl" 分别对应"右下""右上""左上" "左下")。
570 */
571 determineQuadrant(lonlat) {
572
573 var quadrant = "";
574 var center = this.getCenterLonLat();
575
576 quadrant += (lonlat.lat < center.lat) ? "b" : "t";
577 quadrant += (lonlat.lon < center.lon) ? "l" : "r";
578
579 return quadrant;
580 }
581
582 /**
583 * @function Bounds.prototype.wrapDateLine

Callers 1

BoundsSpec.jsFile · 0.80

Calls 1

getCenterLonLatMethod · 0.95

Tested by

no test coverage detected