getConstrainedCenter(targetCenter, targetResolution) {
    const size = this.getViewportSize_(this.getRotation());
    return this.constraints_.center(
      targetCenter,
      targetResolution || this.getResolution(),
      size,
    );
  }
Get a valid position for the view center according to the current constraints.
@param {import("./coordinate.js").Coordinate|undefined} targetCenter Target center position.
@param {number} [targetResolution] Target resolution. If not supplied, the current one will be used.
This is useful to guess a valid center position at a different zoom level.
@return {import("./coordinate.js").Coordinate|undefined} Valid center position.