diff options
author | Mihai Varga <mihai.varga@collabora.com> | 2015-10-20 11:48:42 +0300 |
---|---|---|
committer | Mihai Varga <mihai.varga@collabora.com> | 2015-10-21 18:58:06 +0300 |
commit | 6c9690cb8886e90af25bf72c321e2a77ba775003 (patch) | |
tree | 8166b51d4a03d77a8cff22320ae84dc4bdefe2a7 | |
parent | loleaflet: add id paramater to downloadAs method (diff) | |
download | online-6c9690cb8886e90af25bf72c321e2a77ba775003.tar.gz online-6c9690cb8886e90af25bf72c321e2a77ba775003.zip |
loleaflet: better handle map.remove()
-rw-r--r-- | loleaflet/src/core/Socket.js | 1 | ||||
-rw-r--r-- | loleaflet/src/layer/tile/GridLayer.js | 5 | ||||
-rw-r--r-- | loleaflet/src/map/Map.js | 3 |
3 files changed, 6 insertions, 3 deletions
diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js index 947adf5619..a1c3e72109 100644 --- a/loleaflet/src/core/Socket.js +++ b/loleaflet/src/core/Socket.js @@ -22,6 +22,7 @@ L.Socket = { close: function () { this.socket.onerror = function () {}; this.socket.onclose = function () {}; + this.socket.onmessage = function () {}; this.socket.close(); }, diff --git a/loleaflet/src/layer/tile/GridLayer.js b/loleaflet/src/layer/tile/GridLayer.js index b11a51a90e..df981f5b2d 100644 --- a/loleaflet/src/layer/tile/GridLayer.js +++ b/loleaflet/src/layer/tile/GridLayer.js @@ -44,7 +44,12 @@ L.GridLayer = L.Layer.extend({ this._container = null; this._tileZoom = null; clearTimeout(this._preFetchIdle); + clearTimeout(this._previewInvalidator); clearInterval(this._tilesPreFetcher); + + if (this._selections) { + this._map.removeLayer(this._selections); + } if (this._cursorMarker) { this._cursorMarker.remove(); } diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js index df230b967f..a0ced6d70a 100644 --- a/loleaflet/src/map/Map.js +++ b/loleaflet/src/map/Map.js @@ -246,9 +246,6 @@ L.Map = L.Evented.extend({ } if (this._docLayer) { - if (this._docLayer._selections) { - this.removeLayer(this._docLayer._selections); - } this.removeLayer(this._docLayer); } this.removeControls(); |