no js exceptions when grid is inactive

This commit is contained in:
Laura Klünder 2018-12-17 18:01:10 +01:00
parent 5c334dd783
commit 20402b364d

View file

@ -1545,6 +1545,8 @@ L.SquareGridLayer = L.Layer.extend({
onRemove: function(map) {
L.DomUtil.remove(this._container);
this.cols = [];
this.rows = [];
map.off('viewreset zoom move zoomend moveend', this._update, this);
},
@ -1553,6 +1555,7 @@ L.SquareGridLayer = L.Layer.extend({
},
_updateGrid: function(map) {
if (!this.cols.length) return;
var mapSize = map.getSize(),
sidebarStart = $('#sidebar').outerWidth() + 15,
searchHeight = $('#search').outerHeight() + 10,