code: function () {
          if (this.handlers.mouse) {
              this.handlers.mouse.deactivate();
          }
          if (this.handlers.keyboard) {
              this.handlers.keyboard.deactivate();
          }
          if (this.resetLayerOnDeactivate) this.layer = null;
          this.allowDraw = false;
          this.downPoint = null;
          this.oldImage = null;
          this.addMode = false;
          this.disconnectFromMap();
          if (this.maskLayer) this.disconnectFromMaskLayer();
          this.removeSnapshot();
          this.clearImage();
          if (this.history) this.history.clear();
          this.map.div.classList.remove(this.drawClass);
          this.map.div.classList.remove(this.waitClass);
          this.map.div.classList.remove(this.addClass);
      }
docs: private