Merge pull request #237 from giscloud/master
Fixed not clearing old tiles
This commit is contained in:
commit
0c887fe7ef
@ -42,7 +42,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);
|
||||
@ -108,8 +112,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