Refine getSize in terms of getWidth and getHeight
This commit is contained in:
@@ -81,9 +81,25 @@ ol.Rectangle.prototype.getCenter = function() {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @return {number} Height.
|
||||
*/
|
||||
ol.Rectangle.prototype.getHeight = function() {
|
||||
return this.maxY - this.minY;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @return {goog.math.Size} Size.
|
||||
*/
|
||||
ol.Rectangle.prototype.getSize = function() {
|
||||
return new goog.math.Size(this.maxX - this.minX, this.maxY - this.minY);
|
||||
return new goog.math.Size(this.getWidth(), this.getHeight());
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @return {number} Width.
|
||||
*/
|
||||
ol.Rectangle.prototype.getWidth = function() {
|
||||
return this.maxX - this.minX;
|
||||
};
|
||||
|
||||
@@ -76,9 +76,17 @@ ol.TileBounds.prototype.forEachTileCoord = function(z, f, opt_obj) {
|
||||
|
||||
/**
|
||||
* @override
|
||||
* @return {goog.math.Size} Size.
|
||||
* @return {number} Height.
|
||||
*/
|
||||
ol.TileBounds.prototype.getSize = function() {
|
||||
return new goog.math.Size(
|
||||
this.maxX - this.minX + 1, this.maxY - this.minY + 1);
|
||||
ol.TileBounds.prototype.getHeight = function() {
|
||||
return this.maxY - this.minY + 1;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @override
|
||||
* @return {number} Width.
|
||||
*/
|
||||
ol.TileBounds.prototype.getWidth = function() {
|
||||
return this.maxX - this.minX + 1;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user