Don't inherit ol.PixelBounds from ol.Rectangle
This commit is contained in:
@@ -1,18 +1,34 @@
|
|||||||
goog.provide('ol.PixelBounds');
|
goog.provide('ol.PixelBounds');
|
||||||
|
|
||||||
goog.require('ol.Rectangle');
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.Rectangle}
|
|
||||||
* @param {number} minX Minimum X.
|
* @param {number} minX Minimum X.
|
||||||
* @param {number} minY Minimum Y.
|
|
||||||
* @param {number} maxX Maximum X.
|
* @param {number} maxX Maximum X.
|
||||||
|
* @param {number} minY Minimum Y.
|
||||||
* @param {number} maxY Maximum Y.
|
* @param {number} maxY Maximum Y.
|
||||||
*/
|
*/
|
||||||
ol.PixelBounds = function(minX, minY, maxX, maxY) {
|
ol.PixelBounds = function(minX, maxX, minY, maxY) {
|
||||||
goog.base(this, minX, minY, maxX, maxY);
|
|
||||||
|
/**
|
||||||
|
* @type {number}
|
||||||
|
*/
|
||||||
|
this.minX = minX;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {number}
|
||||||
|
*/
|
||||||
|
this.maxX = maxX;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {number}
|
||||||
|
*/
|
||||||
|
this.minY = minY;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {number}
|
||||||
|
*/
|
||||||
|
this.maxY = maxY;
|
||||||
|
|
||||||
};
|
};
|
||||||
goog.inherits(ol.PixelBounds, ol.Rectangle);
|
|
||||||
|
|||||||
@@ -150,10 +150,10 @@ ol.tilegrid.TileGrid.prototype.getPixelBoundsForTileCoordAndResolution =
|
|||||||
var tileWidth = tileSize.width / scale;
|
var tileWidth = tileSize.width / scale;
|
||||||
var tileHeight = tileSize.height / scale;
|
var tileHeight = tileSize.height / scale;
|
||||||
var minX = Math.round(tileCoord.x * tileWidth);
|
var minX = Math.round(tileCoord.x * tileWidth);
|
||||||
var minY = Math.round(tileCoord.y * tileHeight);
|
|
||||||
var maxX = Math.round((tileCoord.x + 1) * tileWidth);
|
var maxX = Math.round((tileCoord.x + 1) * tileWidth);
|
||||||
|
var minY = Math.round(tileCoord.y * tileHeight);
|
||||||
var maxY = Math.round((tileCoord.y + 1) * tileHeight);
|
var maxY = Math.round((tileCoord.y + 1) * tileHeight);
|
||||||
return new ol.PixelBounds(minX, minY, maxX, maxY);
|
return new ol.PixelBounds(minX, maxX, minY, maxY);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user