Explicitly remove controls from the map on map unload (#6488)

This commit is contained in:
Iván Sánchez Ortega
2019-01-22 18:08:52 +01:00
committed by GitHub
parent 82e850fce1
commit 61ef1776ac

View File

@ -79,6 +79,8 @@ export var Control = Class.extend({
corner.appendChild(container);
}
this._map.on('unload', this.remove, this);
return this;
},
@ -95,6 +97,7 @@ export var Control = Class.extend({
this.onRemove(this._map);
}
this._map.off('unload', this.remove, this);
this._map = null;
return this;