From ddf7ac6e426c76a51d1ecef5d42a56b48f82523c Mon Sep 17 00:00:00 2001 From: mike-000 <49240900+mike-000@users.noreply.github.com> Date: Sat, 3 Jul 2021 11:13:19 +0100 Subject: [PATCH] Add zDirection to options --- src/ol/source/BingMaps.js | 4 ++++ src/ol/source/CartoDB.js | 4 ++++ src/ol/source/OSM.js | 4 ++++ src/ol/source/Stamen.js | 4 ++++ src/ol/source/TileArcGISRest.js | 4 ++++ src/ol/source/TileJSON.js | 4 ++++ src/ol/source/TileWMS.js | 4 ++++ src/ol/source/UTFGrid.js | 4 ++++ src/ol/source/WMTS.js | 4 ++++ 9 files changed, 36 insertions(+) diff --git a/src/ol/source/BingMaps.js b/src/ol/source/BingMaps.js index eee060c7d2..63c2912d18 100644 --- a/src/ol/source/BingMaps.js +++ b/src/ol/source/BingMaps.js @@ -66,6 +66,9 @@ const TOS_ATTRIBUTION = * @property {boolean} [wrapX=true] Whether to wrap the world horizontally. * @property {number} [transition] Duration of the opacity transition for rendering. * To disable the opacity transition, pass `transition: 0`. + * @property {number|import("../array.js").NearestDirectionFunction} [zDirection=0] + * Choose whether to use tiles with a higher or lower zoom level when between integer + * zoom levels. See {@link module:ol/tilegrid/TileGrid~TileGrid#getZForResolution}. */ /** @@ -129,6 +132,7 @@ class BingMaps extends TileImage { tilePixelRatio: hidpi ? 2 : 1, wrapX: options.wrapX !== undefined ? options.wrapX : true, transition: options.transition, + zDirection: options.zDirection, }); /** diff --git a/src/ol/source/CartoDB.js b/src/ol/source/CartoDB.js index 833610823e..7d8f886e7d 100644 --- a/src/ol/source/CartoDB.js +++ b/src/ol/source/CartoDB.js @@ -29,6 +29,9 @@ import {assign} from '../obj.js'; * @property {string} [account] Username as used to access public Carto dashboard at https://{username}.carto.com/. * @property {number} [transition=250] Duration of the opacity transition for rendering. * To disable the opacity transition, pass `transition: 0`. + * @property {number|import("../array.js").NearestDirectionFunction} [zDirection=0] + * Choose whether to use tiles with a higher or lower zoom level when between integer + * zoom levels. See {@link module:ol/tilegrid/TileGrid~TileGrid#getZForResolution}. */ /** @@ -56,6 +59,7 @@ class CartoDB extends XYZ { projection: options.projection, transition: options.transition, wrapX: options.wrapX, + zDirection: options.zDirection, }); /** diff --git a/src/ol/source/OSM.js b/src/ol/source/OSM.js index c28d326c17..e868acc979 100644 --- a/src/ol/source/OSM.js +++ b/src/ol/source/OSM.js @@ -39,6 +39,9 @@ export const ATTRIBUTION = * @property {string} [url='https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png'] URL template. * Must include `{x}`, `{y}` or `{-y}`, and `{z}` placeholders. * @property {boolean} [wrapX=true] Whether to wrap the world horizontally. + * @property {number|import("../array.js").NearestDirectionFunction} [zDirection=0] + * Choose whether to use tiles with a higher or lower zoom level when between integer + * zoom levels. See {@link module:ol/tilegrid/TileGrid~TileGrid#getZForResolution}. */ /** @@ -81,6 +84,7 @@ class OSM extends XYZ { transition: options.transition, url: url, wrapX: options.wrapX, + zDirection: options.zDirection, }); } } diff --git a/src/ol/source/Stamen.js b/src/ol/source/Stamen.js index c0dca30c6d..bde19902af 100644 --- a/src/ol/source/Stamen.js +++ b/src/ol/source/Stamen.js @@ -104,6 +104,9 @@ const ProviderConfig = { * To disable the opacity transition, pass `transition: 0`. * @property {string} [url] URL template. Must include `{x}`, `{y}` or `{-y}`, and `{z}` placeholders. * @property {boolean} [wrapX=true] Whether to wrap the world horizontally. + * @property {number|import("../array.js").NearestDirectionFunction} [zDirection=0] + * Choose whether to use tiles with a higher or lower zoom level when between integer + * zoom levels. See {@link module:ol/tilegrid/TileGrid~TileGrid#getZForResolution}. */ /** @@ -145,6 +148,7 @@ class Stamen extends XYZ { transition: options.transition, url: url, wrapX: options.wrapX, + zDirection: options.zDirection, }); } } diff --git a/src/ol/source/TileArcGISRest.js b/src/ol/source/TileArcGISRest.js index ed76984d4a..02b2f30aad 100644 --- a/src/ol/source/TileArcGISRest.js +++ b/src/ol/source/TileArcGISRest.js @@ -51,6 +51,9 @@ import {hash as tileCoordHash} from '../tilecoord.js'; * transition, pass `transition: 0`. * @property {Array} [urls] ArcGIS Rest service urls. Use this instead of `url` when the ArcGIS * Service supports multiple urls for export requests. + * @property {number|import("../array.js").NearestDirectionFunction} [zDirection=0] + * Choose whether to use tiles with a higher or lower zoom level when between integer + * zoom levels. See {@link module:ol/tilegrid/TileGrid~TileGrid#getZForResolution}. */ /** @@ -82,6 +85,7 @@ class TileArcGISRest extends TileImage { urls: options.urls, wrapX: options.wrapX !== undefined ? options.wrapX : true, transition: options.transition, + zDirection: options.zDirection, }); /** diff --git a/src/ol/source/TileJSON.js b/src/ol/source/TileJSON.js index 3ea4a969b5..33aae2ce4d 100644 --- a/src/ol/source/TileJSON.js +++ b/src/ol/source/TileJSON.js @@ -59,6 +59,9 @@ import {jsonp as requestJSONP} from '../net.js'; * @property {boolean} [wrapX=true] Whether to wrap the world horizontally. * @property {number} [transition] Duration of the opacity transition for rendering. * To disable the opacity transition, pass `transition: 0`. + * @property {number|import("../array.js").NearestDirectionFunction} [zDirection=0] + * Choose whether to use tiles with a higher or lower zoom level when between integer + * zoom levels. See {@link module:ol/tilegrid/TileGrid~TileGrid#getZForResolution}. */ /** @@ -82,6 +85,7 @@ class TileJSON extends TileImage { tileLoadFunction: options.tileLoadFunction, wrapX: options.wrapX !== undefined ? options.wrapX : true, transition: options.transition, + zDirection: options.zDirection, }); /** diff --git a/src/ol/source/TileWMS.js b/src/ol/source/TileWMS.js index 4632d950f9..a41a223564 100644 --- a/src/ol/source/TileWMS.js +++ b/src/ol/source/TileWMS.js @@ -69,6 +69,9 @@ import {hash as tileCoordHash} from '../tilecoord.js'; * but they will be wrapped horizontally to render multiple worlds. * @property {number} [transition] Duration of the opacity transition for rendering. * To disable the opacity transition, pass `transition: 0`. + * @property {number|import("../array.js").NearestDirectionFunction} [zDirection=0] + * Choose whether to use tiles with a higher or lower zoom level when between integer + * zoom levels. See {@link module:ol/tilegrid/TileGrid~TileGrid#getZForResolution}. */ /** @@ -103,6 +106,7 @@ class TileWMS extends TileImage { urls: options.urls, wrapX: options.wrapX !== undefined ? options.wrapX : true, transition: options.transition, + zDirection: options.zDirection, }); /** diff --git a/src/ol/source/UTFGrid.js b/src/ol/source/UTFGrid.js index 77903bb171..e906ce3b75 100644 --- a/src/ol/source/UTFGrid.js +++ b/src/ol/source/UTFGrid.js @@ -268,6 +268,9 @@ export class CustomTile extends Tile { * If not provided, `url` must be configured. * @property {string} [url] TileJSON endpoint that provides the configuration for this source. * Request will be made through JSONP. If not provided, `tileJSON` must be configured. + * @property {number|import("../array.js").NearestDirectionFunction} [zDirection=0] + * Choose whether to use tiles with a higher or lower zoom level when between integer + * zoom levels. See {@link module:ol/tilegrid/TileGrid~TileGrid#getZForResolution}. */ /** @@ -283,6 +286,7 @@ class UTFGrid extends TileSource { super({ projection: getProjection('EPSG:3857'), state: SourceState.LOADING, + zDirection: options.zDirection, }); /** diff --git a/src/ol/source/WMTS.js b/src/ol/source/WMTS.js index 4366528558..4ca3979a6b 100644 --- a/src/ol/source/WMTS.js +++ b/src/ol/source/WMTS.js @@ -54,6 +54,9 @@ import {find, findIndex, includes} from '../array.js'; * @property {boolean} [wrapX=false] Whether to wrap the world horizontally. * @property {number} [transition] Duration of the opacity transition for rendering. * To disable the opacity transition, pass `transition: 0`. + * @property {number|import("../array.js").NearestDirectionFunction} [zDirection=0] + * Choose whether to use tiles with a higher or lower zoom level when between integer + * zoom levels. See {@link module:ol/tilegrid/TileGrid~TileGrid#getZForResolution}. */ /** @@ -99,6 +102,7 @@ class WMTS extends TileImage { urls: urls, wrapX: options.wrapX !== undefined ? options.wrapX : false, transition: options.transition, + zDirection: options.zDirection, }); /**