setMap(map) {
    const oldMap = this.getMap();

    if (oldMap) {
      this.box_.setMap(null);

      if (this.startPixel_) {
        this.dispatchEvent(
          new DragBoxEvent(DragBoxEventType.BOXCANCEL, this.startPixel_, null),
        );
        this.startPixel_ = null;
      }
    }

    super.setMap(map);
  }
@param {import("../Map.js").default|null} map Map.
@override