setMap(map) {
    if (this.map_) {
      this.element?.remove();
    }
    for (let i = 0, ii = this.listenerKeys.length; i < ii; ++i) {
      unlistenByKey(this.listenerKeys[i]);
    }
    this.listenerKeys.length = 0;
    this.map_ = map;
    if (map) {
      const target = this.target_ ?? map.getOverlayContainerStopEvent();
      if (this.element) {
        target.appendChild(this.element);
      }
      if (this.render !== VOID) {
        this.listenerKeys.push(
          listen(map, MapEventType.POSTRENDER, this.render, this),
        );
      }
      map.render();
    }
  }
Remove the control from its current map and attach it to the new map.
Pass `null` to just remove the control from the current map.
Subclasses may set up event handlers to get notified about changes to
the map here.
@param {import("../Map.js").default|null} map Map.
@api