fixed not clearing old layer content in case of non animated pan or zoom
This commit is contained in:
parent
3e61594205
commit
061f3d6832
@ -41,7 +41,11 @@ L.TileLayer = L.Class.extend({
|
||||
this._createTileProto();
|
||||
|
||||
// set up events
|
||||
map.on('viewreset', this._reset, this);
|
||||
map.on('viewreset',
|
||||
function(e) {
|
||||
this._reset(e.hard);
|
||||
},
|
||||
this);
|
||||
|
||||
if (this.options.updateWhenIdle) {
|
||||
map.on('moveend', this._update, this);
|
||||
@ -107,8 +111,10 @@ L.TileLayer = L.Class.extend({
|
||||
}
|
||||
},
|
||||
|
||||
_reset: function() {
|
||||
_reset: function(clearOldContainer) {
|
||||
this._tiles = {};
|
||||
if (clearOldContainer)
|
||||
this._container.innerHTML = "";
|
||||
this._initContainer();
|
||||
this._container.innerHTML = '';
|
||||
},
|
||||
|
@ -356,7 +356,7 @@ L.Map = L.Class.extend({
|
||||
}
|
||||
|
||||
this._tileLayersToLoad = this._tileLayersNum;
|
||||
this.fire('viewreset');
|
||||
this.fire('viewreset', {hard: !preserveMapOffset});
|
||||
|
||||
this.fire('move');
|
||||
if (zoomChanged) { this.fire('zoomend'); }
|
||||
|
Loading…
Reference in New Issue
Block a user