From 00483025cdb3b94f9adb4126a6da0362d0c7de9d Mon Sep 17 00:00:00 2001 From: James Lyne Date: Tue, 31 Aug 2021 16:00:11 +0100 Subject: [PATCH] Correctly cleanup CoordinatesControl event handlers --- src/leaflet/control/CoordinatesControl.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/leaflet/control/CoordinatesControl.ts b/src/leaflet/control/CoordinatesControl.ts index 88e56e6..b4636bd 100644 --- a/src/leaflet/control/CoordinatesControl.ts +++ b/src/leaflet/control/CoordinatesControl.ts @@ -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; }