Change ol.TileCoord to an Array

This commit is contained in:
Éric Lemoine
2014-08-15 23:33:22 +02:00
parent 0d20b337a0
commit ba035abb1f
29 changed files with 318 additions and 323 deletions

View File

@@ -6,6 +6,7 @@ goog.require('ol.TileCoord');
goog.require('ol.TileState');
goog.require('ol.dom');
goog.require('ol.source.Tile');
goog.require('ol.tilecoord');
goog.require('ol.tilegrid.TileGrid');
@@ -25,7 +26,7 @@ ol.DebugTile_ = function(tileCoord, tileGrid) {
* @private
* @type {number}
*/
this.tileSize_ = tileGrid.getTileSize(tileCoord.z);
this.tileSize_ = tileGrid.getTileSize(tileCoord[0]);
/**
* @private
@@ -56,7 +57,8 @@ ol.DebugTile_.prototype.getImage = function(opt_context) {
context.textAlign = 'center';
context.textBaseline = 'middle';
context.font = '24px sans-serif';
context.fillText(this.tileCoord.toString(), tileSize / 2, tileSize / 2);
context.fillText(ol.tilecoord.toString(this.tileCoord),
tileSize / 2, tileSize / 2);
this.canvasByContext_[key] = context.canvas;
return context.canvas;
@@ -121,7 +123,7 @@ ol.source.TileDebug.prototype.getTile = function(z, x, y) {
if (this.tileCache_.containsKey(tileCoordKey)) {
return /** @type {!ol.DebugTile_} */ (this.tileCache_.get(tileCoordKey));
} else {
var tile = new ol.DebugTile_(new ol.TileCoord(z, x, y), this.tileGrid);
var tile = new ol.DebugTile_([z, x, y], this.tileGrid);
this.tileCache_.set(tileCoordKey, tile);
return tile;
}