From ff10d0029766e8b5f9a8b7b911a29c637c9c41b8 Mon Sep 17 00:00:00 2001 From: kerryarts Date: Fri, 21 Nov 2014 17:11:10 +1300 Subject: [PATCH] Check for null before setting the zindex, and instead keep it null initially. This way calls to setZIndex() wont fail if passed null. --- src/layer/tile/GridLayer.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/layer/tile/GridLayer.js b/src/layer/tile/GridLayer.js index 041b6ab1..6203929e 100644 --- a/src/layer/tile/GridLayer.js +++ b/src/layer/tile/GridLayer.js @@ -15,7 +15,7 @@ L.GridLayer = L.Layer.extend({ updateInterval: 200, attribution: null, - zIndex: 'auto', + zIndex: null, bounds: null, minZoom: 0 @@ -124,7 +124,7 @@ L.GridLayer = L.Layer.extend({ }, _updateZIndex: function () { - if (this._container && this.options.zIndex !== undefined) { + if (this._container && this.options.zIndex !== undefined && this.options.zIndex !== null) { this._container.style.zIndex = this.options.zIndex; } },