* @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)
| 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 |
no test coverage detected