Update description for getZForResolution direction

This commit is contained in:
mike-000
2021-07-02 13:03:26 +01:00
parent 90598156b6
commit cb34b30e4b

View File

@@ -634,9 +634,18 @@ class TileGrid {
/** /**
* @param {number} resolution Resolution. * @param {number} resolution Resolution.
* @param {number} [opt_direction] If 0, the nearest resolution will be used. * @param {number|import("../array.js").NearestDirectionFunction} [opt_direction]
* If 1, the nearest lower resolution will be used. If -1, the nearest * If 0, the nearest resolution will be used.
* higher resolution will be used. Default is 0. * If 1, the nearest higher resolution (lower Z) will be used. If -1, the
* nearest lower resolution (higher Z) will be used. Default is 0.
* Use a {@link module:ol/array~NearestDirectionFunction} for more precise control.
*
* For example to change tile Z at the midpoint of zoom levels
* ```js
* function(value, high, low) {
* return value - low * Math.sqrt(high / low);
* }
* ```
* @return {number} Z. * @return {number} Z.
* @api * @api
*/ */