Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adding convenient tile labels for debugging

This will be removed when behavior is right.
  • Loading branch information...
commit f2b325b430fb01490ad96d090a347e742b0619f3 1 parent 033daa4
@tschaub tschaub authored
Showing with 13 additions and 0 deletions.
  1. +13 −0 src/ol/renderer/canvas/canvasvectorlayerrenderer.js
View
13 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;
Please sign in to comment.
Something went wrong with that request. Please try again.