src/ol/tilegrid.js
function resolutionsFromExtent(extent, opt_maxZoom, opt_tileSize) {
  const maxZoom = opt_maxZoom !== undefined ?
    opt_maxZoom : DEFAULT_MAX_ZOOM;

  const height = getHeight(extent);
  const width = getWidth(extent);

  const tileSize = toSize(opt_tileSize !== undefined ?
    opt_tileSize : DEFAULT_TILE_SIZE);
  const maxResolution = Math.max(
    width / tileSize[0], height / tileSize[1]);

  const length = maxZoom + 1;
  const resolutions = new Array(length);
  for (let z = 0; z < length; ++z) {
    resolutions[z] = maxResolution / Math.pow(2, z);
  }
  return resolutions;
}
function resolutionsFromExtent(extent, opt_maxZoom, opt_tileSize) {
  const maxZoom = opt_maxZoom !== undefined ?
    opt_maxZoom : DEFAULT_MAX_ZOOM;

  const height = getHeight(extent);
  const width = getWidth(extent);

  const tileSize = toSize(opt_tileSize !== undefined ?
    opt_tileSize : DEFAULT_TILE_SIZE);
  const maxResolution = Math.max(
    width / tileSize[0], height / tileSize[1]);

  const length = maxZoom + 1;
  const resolutions = new Array(length);
  for (let z = 0; z < length; ++z) {
    resolutions[z] = maxResolution / Math.pow(2, z);
  }
  return resolutions;
}
function resolutionsFromExtent ( extent , opt_maxZoom , opt_tileSize ) { const maxZoom = opt_maxZoom !== undefined ? opt_maxZoom : DEFAULT_MAX_ZOOM ; const height = getHeight ( extent ) ; const width = getWidth ( extent ) ; const tileSize = toSize ( opt_tileSize !== undefined ? opt_tileSize : DEFAULT_TILE_SIZE ) ; const maxResolution = Math . max ( width / tileSize [ 0 ] , height / tileSize [ 1 ] ) ; const length = maxZoom + 1 ; const resolutions = new Array ( length ) ; for ( let z = 0 ; z < length ; ++ z ) { resolutions [ z ] = maxResolution / Math . pow ( 2 , z ) ; } return resolutions ; }
Create a resolutions array from an extent.  A zoom factor of 2 is assumed.
@param {import("./extent.js").Extent} extent Extent.
@param {number=} opt_maxZoom Maximum zoom level (default is
DEFAULT_MAX_ZOOM).
@param {number|import("./size.js").Size=} opt_tileSize Tile size (default uses
DEFAULT_TILE_SIZE).
@return {!Array<number>} Resolutions array.
Create a resolutions array from an extent . A zoom factor of 2 is assumed .