Stop animation before destroy map (#5876)

* Null ref fix:

TypeError: Cannot read property latLngToLayerPoint of null\n    at NewClass.update (http://my.uboro.eu/js/vendor/leaflet-1.2.0.js?t=1503882088:7295:23)\n    at NewClass.setLatLng (http://my.uboro.eu/js/vendor/leaflet-1.2.0.js?t=1503882088:7256:8)\n

* stop animation before destroy map
This commit is contained in:
Alexander Musienko 2017-10-30 10:38:49 -07:00 committed by Vladimir Agafonkin
parent f6e1a9be91
commit 50b77520b3

View File

@ -722,6 +722,8 @@ export var Map = Evented.extend({
this._containerId = undefined;
}
this._stop();
DomUtil.remove(this._mapPane);
if (this._clearControlPos) {
@ -1627,7 +1629,9 @@ export var Map = Evented.extend({
_onZoomTransitionEnd: function () {
if (!this._animatingZoom) { return; }
DomUtil.removeClass(this._mapPane, 'leaflet-zoom-anim');
if (this._mapPane) {
DomUtil.removeClass(this._mapPane, 'leaflet-zoom-anim');
}
this._animatingZoom = false;