Don't re-use ol.TileCoord object

This commit is contained in:
Tom Payne
2012-08-04 18:46:54 +02:00
parent 051175ea68
commit c2b1a94298

View File

@@ -86,16 +86,10 @@ ol.TileBounds.prototype.equals = function(tileBounds) {
* @template T
*/
ol.TileBounds.prototype.forEachTileCoord = function(z, f, opt_obj) {
var tileCoord = new ol.TileCoord(z, 0, 0);
var x, y;
for (x = this.minX; x <= this.maxX; ++x) {
tileCoord.x = x;
for (y = this.minY; y <= this.maxY; ++y) {
tileCoord.y = y;
f.call(opt_obj, tileCoord);
goog.asserts.assert(tileCoord.z == z);
goog.asserts.assert(tileCoord.x == x);
goog.asserts.assert(tileCoord.y == y);
f.call(opt_obj, new ol.TileCoord(z, x, y));
}
}
};