Adding convenient tile labels for debugging

This will be removed when behavior is right.
This commit is contained in:
Tim Schaub
2013-01-24 17:16:54 -07:00
parent 033daa425b
commit f2b325b430

View File

@@ -264,6 +264,19 @@ ol.renderer.canvas.VectorLayer.prototype.renderFrame =
tile.height = tileSize.height;
tileContext = tile.getContext('2d');
// TODO: remove me
if (goog.DEBUG) {
tileContext.strokeStyle = '#999999';
tileContext.fillStyle = '#999999';
tileContext.textAlign = 'center';
tileContext.textBaseline = 'middle';
tileContext.font = '24px sans-serif';
tileContext.strokeRect(0.5, 0.5, tileSize.width - 1,
tileSize.height - 1);
tileContext.fillText(tileCoord.toString(), tileSize.width / 2,
tileSize.height / 2);
}
tileContext.drawImage(sketchCanvas,
-x * tileSize.width, -(tileRange.maxY - y) * tileSize.height);
this.tileCache_[key] = tile;