[Libreoffice-commits] online.git: loleaflet/src

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Sep 12 20:29:09 UTC 2018


 loleaflet/src/core/Socket.js          |    3 +--
 loleaflet/src/layer/tile/GridLayer.js |   10 ++++++++++
 loleaflet/src/layer/tile/TileLayer.js |    3 +--
 loleaflet/src/map/Map.js              |    3 +--
 4 files changed, 13 insertions(+), 6 deletions(-)

New commits:
commit 5fdc049a79b317a5a53782d24237ddde80dff2a9
Author:     Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Wed Sep 12 21:36:46 2018 +0200
Commit:     Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Wed Sep 12 22:18:34 2018 +0200

    Create a method which invalidates and requests all the tiles
    
    Used after reconnection for example.
    
    Change-Id: Ie9a15ec1fdec71ca8aba7d9b7417b05005c6c69a

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) {


More information about the Libreoffice-commits mailing list