loleaflet: remove the bounding rectangle when the hook is removed

Change-Id: I9475c2297882fb848010996087374af5dde3d214
This commit is contained in:
Henry Castro 2018-11-28 16:14:36 -04:00 committed by Jan Holesovsky
parent 1c191865ec
commit 5822737a84

View file

@ -165,6 +165,11 @@ L.Handler.PathTransform = L.Handler.extend({
.off('dragstart', this._onDragStart, this)
.off('drag', this._onDrag, this)
.off('dragend', this._onDragEnd, this);
if (this._map.hasLayer(this._rect)) {
this._map.removeLayer(this._rect);
}
this._handlersGroup = null;
this._rect = null;
this._handlers = [];