From 6c50fc9eb18c89de2201a0f9979b0b329d612a08 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Tue, 11 Mar 2014 13:59:02 +0000 Subject: [PATCH] oops - can only bringToFront when a layer is acutally on the map - so check debug layer is enabled --- code/map_data_debug.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/code/map_data_debug.js b/code/map_data_debug.js index 225d2db6..7796b809 100644 --- a/code/map_data_debug.js +++ b/code/map_data_debug.js @@ -29,7 +29,10 @@ window.RenderDebugTiles.prototype.create = function(id,bounds) { var l = L.rectangle(bounds,s); this.debugTileToRectangle[id] = l; this.debugTileLayer.addLayer(l); - l.bringToBack(); + if (map.hasLayer(this.debugTileLayer)) { + // only bring to back if we have the debug layer turned on + l.bringToBack(); + } } window.RenderDebugTiles.prototype.setColour = function(id,bordercol,fillcol) {