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

Mihai Varga mihai.varga at collabora.com
Mon Jul 27 02:26:44 PDT 2015


 loleaflet/src/layer/tile/GridLayer.js |    2 +-
 loleaflet/src/layer/tile/TileLayer.js |    1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 04be35fa39664202091cd97fea3b614c151e3f3f
Author: Mihai Varga <mihai.varga at collabora.com>
Date:   Mon Jul 27 12:26:08 2015 +0300

    loleaflet: prefetch tiles when all empty tiles have loaded

diff --git a/loleaflet/src/layer/tile/GridLayer.js b/loleaflet/src/layer/tile/GridLayer.js
index 515964f..7b4f7b6 100644
--- a/loleaflet/src/layer/tile/GridLayer.js
+++ b/loleaflet/src/layer/tile/GridLayer.js
@@ -751,7 +751,7 @@ L.GridLayer = L.Layer.extend({
 	},
 
 	_preFetchTiles: function () {
-		if (this._permission === 'edit') {
+		if (this._permission === 'edit' || this._emptyTilesCount > 0) {
 			return;
 		}
 		var center = this._map.getCenter();
diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index f8ddb5e..423a1c2 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -106,6 +106,7 @@ L.TileLayer = L.GridLayer.extend({
 		this._map.on('zoomstart zoomend', this._onZoom, this);
 		this._map.on('clearselection', this._clearSelections, this);
 		this._map.on('copy', this._onCopy, this);
+		this._map.on('alltilesloaded', this._preFetchTiles, this);
 		this._startMarker.on('drag dragend', this._onSelectionHandleDrag, this);
 		this._endMarker.on('drag dragend', this._onSelectionHandleDrag, this);
 		this._textArea = this._map._textArea;


More information about the Libreoffice-commits mailing list