diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2020-08-21 16:40:29 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2020-09-02 14:57:34 +0200 |
commit | 0fd5cfc611ea683fbd22bbe6f0bb8dc9fd78437f (patch) | |
tree | ce5d98ab1399985876b97f19fa9d24c45ed5e0e9 | |
parent | 55ebf8dc2ba46e406f640d0f861753c94a73e4fb (diff) |
calc tiles: more debug helpers
Change-Id: I24370b2a35fdfeca360cbaeb296cd2dd3a11e768
-rw-r--r-- | loleaflet/src/layer/tile/CanvasTileLayer.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/loleaflet/src/layer/tile/CanvasTileLayer.js b/loleaflet/src/layer/tile/CanvasTileLayer.js index 5829239fa..9f3b6e02f 100644 --- a/loleaflet/src/layer/tile/CanvasTileLayer.js +++ b/loleaflet/src/layer/tile/CanvasTileLayer.js @@ -37,7 +37,7 @@ L.TileCoordData.parseKey = function (keyString) { L.CanvasTilePainter = L.Class.extend({ options: { - debug: false, + debug: true, }, initialize: function (layer, enableImageSmoothing) { @@ -133,7 +133,10 @@ L.CanvasTilePainter = L.Class.extend({ clear: function () { this._canvasCtx.save(); this._canvasCtx.scale(this._dpiScale, this._dpiScale); - this._canvasCtx.fillStyle = 'white'; + if (this.options.debug) + this._canvasCtx.fillStyle = 'red'; + else + this._canvasCtx.fillStyle = 'white'; this._canvasCtx.fillRect(0, 0, this._width, this._height); this._canvasCtx.restore(); }, @@ -277,6 +280,10 @@ L.CanvasTilePainter = L.Class.extend({ }, _paintWholeCanvas: function () { + + if (this.options.debug) + this.clear(); + var zoom = this._lastZoom || Math.round(this._map.getZoom()); var part = this._lastPart || this._layer._selectedPart; |