Create a method which invalidates and requests all the tiles

Used after reconnection for example.

Change-Id: Ie9a15ec1fdec71ca8aba7d9b7417b05005c6c69a
This commit is contained in:
Tamás Zolnai 2018-09-12 21:36:46 +02:00
parent 87b85ff8f0
commit 5fdc049a79
4 changed files with 13 additions and 6 deletions

View file

@ -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);
}

View file

@ -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());

View file

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

View file

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