From a051892b92c72630b48e95587ee5563d3378f37b Mon Sep 17 00:00:00 2001 From: Robert Orthofer Date: Tue, 12 Mar 2019 12:48:26 +0100 Subject: [PATCH] enhance tile-debug readability this commit enhances the readability of tile debug coordinates by adding a stroke for better readability on aerial imagery and a maxWidth for high zoom levels --- src/ol/source/TileDebug.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ol/source/TileDebug.js b/src/ol/source/TileDebug.js index c6dc430955..fb6af22061 100644 --- a/src/ol/source/TileDebug.js +++ b/src/ol/source/TileDebug.js @@ -55,10 +55,12 @@ class LabeledTile extends Tile { context.strokeRect(0.5, 0.5, tileSize[0] + 0.5, tileSize[1] + 0.5); context.fillStyle = 'grey'; + context.strokeStyle = 'white'; context.textAlign = 'center'; context.textBaseline = 'middle'; - context.font = '24px sans-serif'; - context.fillText(this.text_, tileSize[0] / 2, tileSize[1] / 2); + context.font = 'bold 24px sans-serif'; + context.fillText(this.text_, tileSize[0] / 2, tileSize[1] / 2, tileSize[0]); + context.strokeText(this.text_, tileSize[0] / 2, tileSize[1] / 2, tileSize[0]); this.canvas_ = context.canvas; return context.canvas;