summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2020-08-21 16:40:29 +0100
committerJan Holesovsky <kendy@collabora.com>2020-09-15 22:22:52 +0200
commit3ccf2c4a30db762ce35dc6957569fff6a8270957 (patch)
tree0c73819173e3b1dcc62043aeb5171107d880e03c
parent8e4a4de87c5bacfe97343d1daa1c75e3e2eea882 (diff)
calc tiles: more debug helpers
Change-Id: I24370b2a35fdfeca360cbaeb296cd2dd3a11e768
-rw-r--r--loleaflet/src/layer/tile/CanvasTileLayer.js11
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;