Permalink
Browse files

Adding convenient tile labels for debugging

This will be removed when behavior is right.
  • Loading branch information...
1 parent 033daa4 commit f2b325b430fb01490ad96d090a347e742b0619f3 @tschaub tschaub committed Jan 25, 2013
Showing with 13 additions and 0 deletions.
  1. +13 −0 src/ol/renderer/canvas/canvasvectorlayerrenderer.js
@@ -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;

0 comments on commit f2b325b

Please sign in to comment.