no js exceptions when grid is inactive
This commit is contained in:
parent
5c334dd783
commit
20402b364d
1 changed files with 3 additions and 0 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue