Correctly cleanup CoordinatesControl event handlers

This commit is contained in:
James Lyne 2021-08-31 16:00:11 +01:00
parent f1d38e7485
commit 00483025cd

View File

@ -81,9 +81,9 @@ export class CoordinatesControl extends Control {
return this;
}
this._map.on('mousemove', this._onMouseMove, this);
this._map.on('mouseout', this._onMouseOut, this);
Control.prototype.remove.call(this);
this._map.off('mousemove', this._onMouseMove, this);
this._map.off('mouseout', this._onMouseOut, this);
super.remove();
return this;
}