diff --git a/src/control/Control.js b/src/control/Control.js index 6db9f4bb0fa..301541914c4 100644 --- a/src/control/Control.js +++ b/src/control/Control.js @@ -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;