diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js index df33801d9..5dc77629f 100644 --- a/loleaflet/src/core/Socket.js +++ b/loleaflet/src/core/Socket.js @@ -799,8 +799,7 @@ L.Socket = L.Class.extend({ // we are reconnecting ... this._reconnecting = false; this._map._docLayer._resetClientVisArea(); - this._map._docLayer._onMessage('invalidatetiles: EMPTY', null); - this._map._docLayer._update(); + this._map._docLayer._requestNewTiles(); this._map.fire('statusindicator', {statusType: 'reconnected'}); this._map.setPermission(this._map.options.permission); } diff --git a/loleaflet/src/layer/tile/GridLayer.js b/loleaflet/src/layer/tile/GridLayer.js index 215fc166e..ac4ec1190 100644 --- a/loleaflet/src/layer/tile/GridLayer.js +++ b/loleaflet/src/layer/tile/GridLayer.js @@ -700,6 +700,16 @@ L.GridLayer = L.Layer.extend({ } }, + _requestNewTiles: function () { + this._onMessage('invalidatetiles: EMPTY', null); + this._update(); + }, + + toggleTileDebugMode: function() { + this.toggleTileDebugModeImpl(); + this._requestNewTiles(); + }, + _sendClientVisibleArea: function (forceUpdate) { var visibleTopLeft = this._latLngToTwips(this._map.getBounds().getNorthWest()); var visibleBottomRight = this._latLngToTwips(this._map.getBounds().getSouthEast()); diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js index c315b9399..d41a58f6d 100644 --- a/loleaflet/src/layer/tile/TileLayer.js +++ b/loleaflet/src/layer/tile/TileLayer.js @@ -484,7 +484,7 @@ L.TileLayer = L.GridLayer.extend({ } }, - toggleTileDebugMode: function() { + toggleTileDebugModeImpl: function() { this._debug = !this._debug; if (!this._debug) { this._map.removeLayer(this._debugInfo); @@ -498,7 +498,6 @@ L.TileLayer = L.GridLayer.extend({ } this._debugInit(); } - this._onMessage('invalidatetiles: EMPTY', null); }, _onCommandValuesMsg: function (textMsg) { diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js index c87174880..fb075ff15 100644 --- a/loleaflet/src/map/Map.js +++ b/loleaflet/src/map/Map.js @@ -851,9 +851,8 @@ L.Map = L.Evented.extend({ this._socket.sendMessage('useractive'); this._active = true; if (this._docLayer) { - this._docLayer._onMessage('invalidatetiles: EMPTY', null); this._docLayer._resetClientVisArea(); - this._docLayer._update(); + this._docLayer._requestNewTiles(); } if (vex.dialogID > 0) {