From 0a506d30270a6e508dfaa71a2ce94455ee75b3b7 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Sun, 2 Mar 2014 01:02:40 +0000 Subject: [PATCH] debug tile display: remove the 'ok' tiles from screen when the refresh completes - makes it practical to leave the layer on at all times --- code/map_data_debug.js | 11 +++++++++++ code/map_data_request.js | 1 + 2 files changed, 12 insertions(+) diff --git a/code/map_data_debug.js b/code/map_data_debug.js index 44783794..b0482daa 100644 --- a/code/map_data_debug.js +++ b/code/map_data_debug.js @@ -49,3 +49,14 @@ window.RenderDebugTiles.prototype.setState = function(id,state) { } this.setColour (id, col, fill); } + + +window.RenderDebugTiles.prototype.removeOkTiles = function() { + var _this = this; + $.each(this.debugTileToRectangle, function(id,layer) { + if (layer.options.color == '#0f0' && layer.options.color == '#0f0') { + _this.debugTileLayer.removeLayer(layer); + delete _this.debugTileToRectangle[id]; + } + }); +} diff --git a/code/map_data_request.js b/code/map_data_request.js index e2f5008c..9b21d615 100644 --- a/code/map_data_request.js +++ b/code/map_data_request.js @@ -323,6 +323,7 @@ window.MapDataRequest.prototype.processRequestQueue = function(isFirstPass) { if (Object.keys(this.queuedTiles).length == 0) { this.render.endRenderPass(); + this.debugTiles.removeOkTiles(); var endTime = new Date().getTime(); var duration = (endTime - this.refreshStartTime)/1000;