setMap(map) {
    if (this.mapPrecomposeKey_) {
      unlistenByKey(this.mapPrecomposeKey_);
      this.mapPrecomposeKey_ = null;
    }
    if (!map) {
      this.changed();
    }
    if (this.mapRenderKey_) {
      unlistenByKey(this.mapRenderKey_);
      this.mapRenderKey_ = null;
    }
    if (map) {
      this.mapPrecomposeKey_ = listen(
        map,
        RenderEventType.PRECOMPOSE,
        this.handlePrecompose_,
        this,
      );
      this.mapRenderKey_ = listen(this, EventType.CHANGE, map.render, map);
      this.changed();
    }
  }
Sets the layer to be rendered on top of other layers on a map. The map will
not manage this layer in its layers collection. This
is useful for temporary layers. To remove an unmanaged layer from the map,
use `#setMap(null)`.

To add the layer to a map and have it managed by the map, use
{@link module:ol/Map~Map#addLayer} instead.
@param {import("../Map.js").default|null} map Map.
@api