Don't inherit ol.PixelBounds from ol.Rectangle

This commit is contained in:
Tom Payne
2013-04-16 13:21:27 +02:00
parent 1ad7765f2f
commit 0da8b0ae7f
2 changed files with 25 additions and 9 deletions

View File

@@ -1,18 +1,34 @@
goog.provide('ol.PixelBounds');
goog.require('ol.Rectangle');
/**
* @constructor
* @extends {ol.Rectangle}
* @param {number} minX Minimum X.
* @param {number} minY Minimum Y.
* @param {number} maxX Maximum X.
* @param {number} minY Minimum Y.
* @param {number} maxY Maximum Y.
*/
ol.PixelBounds = function(minX, minY, maxX, maxY) {
goog.base(this, minX, minY, maxX, maxY);
ol.PixelBounds = function(minX, maxX, minY, 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);

View File

@@ -150,10 +150,10 @@ ol.tilegrid.TileGrid.prototype.getPixelBoundsForTileCoordAndResolution =
var tileWidth = tileSize.width / scale;
var tileHeight = tileSize.height / scale;
var minX = Math.round(tileCoord.x * tileWidth);
var minY = Math.round(tileCoord.y * tileHeight);
var maxX = Math.round((tileCoord.x + 1) * tileWidth);
var minY = Math.round(tileCoord.y * 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);
};