fire load after viewreset/moveend to fix Canvas rendering

This commit is contained in:
Vladimir Agafonkin 2013-12-19 18:04:55 -05:00
parent 70e3500716
commit ce29ac59a9

View File

@ -486,10 +486,6 @@ L.Map = L.Evented.extend({
var loading = !this._loaded; var loading = !this._loaded;
this._loaded = true; this._loaded = true;
if (loading) {
this.fire('load');
}
this.fire('viewreset', {hard: !preserveMapOffset}); this.fire('viewreset', {hard: !preserveMapOffset});
this.fire('move'); this.fire('move');
@ -499,6 +495,10 @@ L.Map = L.Evented.extend({
} }
this.fire('moveend', {hard: !preserveMapOffset}); this.fire('moveend', {hard: !preserveMapOffset});
if (loading) {
this.fire('load');
}
}, },
_rawPanBy: function (offset) { _rawPanBy: function (offset) {