diff --git a/spec/suites/layer/tile/GridLayerSpec.js b/spec/suites/layer/tile/GridLayerSpec.js index 62f1ba65..c8e8e243 100644 --- a/spec/suites/layer/tile/GridLayerSpec.js +++ b/spec/suites/layer/tile/GridLayerSpec.js @@ -1008,4 +1008,13 @@ describe('GridLayer', function () { }).to.throwError('Attempted to load an infinite number of tiles'); }); }); + + it("doesn't call map's getZoomScale method with null after _invalidateAll method was called", function () { + map.setView([0, 0], 0); + var grid = L.gridLayer().addTo(map); + var wrapped = sinon.spy(map, 'getZoomScale'); + grid._invalidateAll(); + grid.redraw(); + expect(wrapped.neverCalledWith(sinon.match.any, null)).to.be(true); + }); }); diff --git a/src/layer/tile/GridLayer.js b/src/layer/tile/GridLayer.js index 86370e1a..57168205 100755 --- a/src/layer/tile/GridLayer.js +++ b/src/layer/tile/GridLayer.js @@ -172,7 +172,7 @@ export var GridLayer = Layer.extend({ DomUtil.remove(this._container); map._removeZoomLimit(this); this._container = null; - this._tileZoom = null; + this._tileZoom = undefined; }, // @method bringToFront: this @@ -466,7 +466,7 @@ export var GridLayer = Layer.extend({ } this._removeAllTiles(); - this._tileZoom = null; + this._tileZoom = undefined; }, _retainParent: function (x, y, z, minZoom) {