Browse Source

Fix: calling _updateLayers when not attached to map

gh-pages
Gregor MacLennan 9 years ago
parent
commit
1f8f3ead64
1 changed files with 3 additions and 0 deletions
  1. 3
    0
      index.js

+ 3
- 0
index.js View File

@@ -132,6 +132,9 @@ L.Control.SideBySide = L.Control.extend({
132 132
   },
133 133
 
134 134
   _updateLayers: function () {
135
+    if (!this._map) {
136
+      return this
137
+    }
135 138
     var prevLeft = this._leftLayer
136 139
     var prevRight = this._rightLayer
137 140
     this._leftLayer = this._rightLayer = null

Loading…
Cancel
Save