From 27a9f056e0f050b89159f271878b8cb2b662965c Mon Sep 17 00:00:00 2001 From: mike-000 <49240900+mike-000@users.noreply.github.com> Date: Wed, 3 Aug 2022 11:43:04 +0100 Subject: [PATCH] remove deprecated imageSmoothing --- src/ol/source/BingMaps.js | 9 +-------- src/ol/source/IIIF.js | 9 +-------- src/ol/source/Image.js | 10 ++-------- src/ol/source/ImageArcGISRest.js | 9 +-------- src/ol/source/ImageCanvas.js | 9 +-------- src/ol/source/ImageMapGuide.js | 9 +-------- src/ol/source/ImageStatic.js | 9 +-------- src/ol/source/ImageWMS.js | 9 +-------- src/ol/source/OGCMapTile.js | 9 +-------- src/ol/source/OSM.js | 9 +-------- src/ol/source/Stamen.js | 9 +-------- src/ol/source/TileArcGISRest.js | 9 +-------- src/ol/source/TileImage.js | 10 ++-------- src/ol/source/TileJSON.js | 9 +-------- src/ol/source/TileWMS.js | 9 +-------- src/ol/source/WMTS.js | 9 +-------- src/ol/source/XYZ.js | 9 +-------- src/ol/source/Zoomify.js | 9 +-------- test/browser/spec/ol/source/BingMaps.test.js | 5 ----- test/browser/spec/ol/source/IIIF.test.js | 5 ----- test/browser/spec/ol/source/ImageArcGISRest.test.js | 7 ------- test/browser/spec/ol/source/ImageStatic.test.js | 5 ----- test/browser/spec/ol/source/TileImage.test.js | 5 ----- test/browser/spec/ol/source/TileJSON.test.js | 8 -------- test/browser/spec/ol/source/TileWMS.test.js | 5 ----- test/browser/spec/ol/source/WMTS.test.js | 5 ----- test/browser/spec/ol/source/XYZ.test.js | 5 ----- test/browser/spec/ol/source/Zoomify.test.js | 9 --------- 28 files changed, 20 insertions(+), 203 deletions(-) diff --git a/src/ol/source/BingMaps.js b/src/ol/source/BingMaps.js index b4e6cf6af7..4a137aa911 100644 --- a/src/ol/source/BingMaps.js +++ b/src/ol/source/BingMaps.js @@ -52,7 +52,6 @@ const TOS_ATTRIBUTION = * @property {string} [culture='en-us'] Culture code. * @property {string} key Bing Maps API key. Get yours at https://www.bingmapsportal.com/. * @property {string} imagerySet Type of imagery. - * @property {boolean} [imageSmoothing=true] Deprecated. Use the `interpolate` option instead. * @property {boolean} [interpolate=true] Use interpolated values when resampling. By default, * linear interpolation is used when resampling. Set to false to use the nearest neighbor instead. * @property {number} [maxZoom=21] Max zoom. Default is what's advertized by the BingMaps service. @@ -121,16 +120,10 @@ class BingMaps extends TileImage { constructor(options) { const hidpi = options.hidpi !== undefined ? options.hidpi : false; - let interpolate = - options.imageSmoothing !== undefined ? options.imageSmoothing : true; - if (options.interpolate !== undefined) { - interpolate = options.interpolate; - } - super({ cacheSize: options.cacheSize, crossOrigin: 'anonymous', - interpolate: interpolate, + interpolate: options.interpolate, opaque: true, projection: getProjection('EPSG:3857'), reprojectionErrorThreshold: options.reprojectionErrorThreshold, diff --git a/src/ol/source/IIIF.js b/src/ol/source/IIIF.js index 720d95dffb..96bef99803 100644 --- a/src/ol/source/IIIF.js +++ b/src/ol/source/IIIF.js @@ -19,7 +19,6 @@ import {toSize} from '../size.js'; * @property {null|string} [crossOrigin] The value for the crossOrigin option of the request. * @property {import("../extent.js").Extent} [extent=[0, -height, width, 0]] The extent. * @property {string} [format='jpg'] Requested image format. - * @property {boolean} [imageSmoothing=true] Deprecated. Use the `interpolate` option instead. * @property {boolean} [interpolate=true] Use interpolated values when resampling. By default, * linear interpolation is used when resampling. Set to false to use the nearest neighbor instead. * @property {import("../proj.js").ProjectionLike} [projection] Projection. @@ -70,12 +69,6 @@ class IIIF extends TileImage { */ const options = opt_options || {}; - let interpolate = - options.imageSmoothing !== undefined ? options.imageSmoothing : true; - if (options.interpolate !== undefined) { - interpolate = options.interpolate; - } - let baseUrl = options.url || ''; baseUrl = baseUrl + @@ -340,7 +333,7 @@ class IIIF extends TileImage { attributionsCollapsible: options.attributionsCollapsible, cacheSize: options.cacheSize, crossOrigin: options.crossOrigin, - interpolate: interpolate, + interpolate: options.interpolate, projection: options.projection, reprojectionErrorThreshold: options.reprojectionErrorThreshold, state: options.state, diff --git a/src/ol/source/Image.js b/src/ol/source/Image.js index ea4831ff31..2bb3246246 100644 --- a/src/ol/source/Image.js +++ b/src/ol/source/Image.js @@ -75,7 +75,6 @@ export class ImageSourceEvent extends Event { /** * @typedef {Object} Options * @property {import("./Source.js").AttributionLike} [attributions] Attributions. - * @property {boolean} [imageSmoothing=true] Deprecated. Use the `interpolate` option instead. * @property {boolean} [interpolate=true] Use interpolated values when resampling. By default, * linear interpolation is used when resampling. Set to false to use the nearest neighbor instead. * @property {import("../proj.js").ProjectionLike} [projection] Projection. @@ -97,17 +96,12 @@ class ImageSource extends Source { * @param {Options} options Single image source options. */ constructor(options) { - let interpolate = - options.imageSmoothing !== undefined ? options.imageSmoothing : true; - if (options.interpolate !== undefined) { - interpolate = options.interpolate; - } - super({ attributions: options.attributions, projection: options.projection, state: options.state, - interpolate: interpolate, + interpolate: + options.interpolate !== undefined ? options.interpolate : true, }); /*** diff --git a/src/ol/source/ImageArcGISRest.js b/src/ol/source/ImageArcGISRest.js index 038fad4c41..bc68a6e7e7 100644 --- a/src/ol/source/ImageArcGISRest.js +++ b/src/ol/source/ImageArcGISRest.js @@ -19,7 +19,6 @@ import {containsExtent, getHeight, getWidth} from '../extent.js'; * the remote server. * @property {import("../Image.js").LoadFunction} [imageLoadFunction] Optional function to load an image given * a URL. - * @property {boolean} [imageSmoothing=true] Deprecated. Use the `interpolate` option instead. * @property {boolean} [interpolate=true] Use interpolated values when resampling. By default, * linear interpolation is used when resampling. Set to false to use the nearest neighbor instead. * @property {Object} [params] ArcGIS Rest parameters. This field is optional. Service @@ -58,15 +57,9 @@ class ImageArcGISRest extends ImageSource { constructor(opt_options) { const options = opt_options ? opt_options : {}; - let interpolate = - options.imageSmoothing !== undefined ? options.imageSmoothing : true; - if (options.interpolate !== undefined) { - interpolate = options.interpolate; - } - super({ attributions: options.attributions, - interpolate: interpolate, + interpolate: options.interpolate, projection: options.projection, resolutions: options.resolutions, }); diff --git a/src/ol/source/ImageCanvas.js b/src/ol/source/ImageCanvas.js index d0cd7104dc..b15186c986 100644 --- a/src/ol/source/ImageCanvas.js +++ b/src/ol/source/ImageCanvas.js @@ -36,7 +36,6 @@ import { * the value returned by the function is later changed then * `changed` should be called on the source for the source to * invalidate the current cached image. See: {@link module:ol/Observable~Observable#changed} - * @property {boolean} [imageSmoothing=true] Deprecated. Use the `interpolate` option instead. * @property {boolean} [interpolate=true] Use interpolated values when resampling. By default, * linear interpolation is used when resampling. Set to false to use the nearest neighbor instead. * @property {import("../proj.js").ProjectionLike} [projection] Projection. Default is the view projection. @@ -59,15 +58,9 @@ class ImageCanvasSource extends ImageSource { constructor(opt_options) { const options = opt_options ? opt_options : {}; - let interpolate = - options.imageSmoothing !== undefined ? options.imageSmoothing : true; - if (options.interpolate !== undefined) { - interpolate = options.interpolate; - } - super({ attributions: options.attributions, - interpolate: interpolate, + interpolate: options.interpolate, projection: options.projection, resolutions: options.resolutions, state: options.state, diff --git a/src/ol/source/ImageMapGuide.js b/src/ol/source/ImageMapGuide.js index 710d001bc9..fb94b04dfd 100644 --- a/src/ol/source/ImageMapGuide.js +++ b/src/ol/source/ImageMapGuide.js @@ -31,7 +31,6 @@ import { * @property {Array} [resolutions] Resolutions. * If specified, requests will be made for these resolutions only. * @property {import("../Image.js").LoadFunction} [imageLoadFunction] Optional function to load an image given a URL. - * @property {boolean} [imageSmoothing=true] Deprecated. Use the `interpolate` option instead. * @property {boolean} [interpolate=true] Use interpolated values when resampling. By default, * linear interpolation is used when resampling. Set to false to use the nearest neighbor instead. * @property {Object} [params] Additional parameters. @@ -49,14 +48,8 @@ class ImageMapGuide extends ImageSource { * @param {Options} options ImageMapGuide options. */ constructor(options) { - let interpolate = - options.imageSmoothing !== undefined ? options.imageSmoothing : true; - if (options.interpolate !== undefined) { - interpolate = options.interpolate; - } - super({ - interpolate: interpolate, + interpolate: options.interpolate, projection: options.projection, resolutions: options.resolutions, }); diff --git a/src/ol/source/ImageStatic.js b/src/ol/source/ImageStatic.js index 3e94271933..41f2f02324 100644 --- a/src/ol/source/ImageStatic.js +++ b/src/ol/source/ImageStatic.js @@ -19,7 +19,6 @@ import {get as getProjection} from '../proj.js'; * @property {import("../extent.js").Extent} [imageExtent] Extent of the image in map coordinates. * This is the [left, bottom, right, top] map coordinates of your image. * @property {import("../Image.js").LoadFunction} [imageLoadFunction] Optional function to load an image given a URL. - * @property {boolean} [imageSmoothing=true] Deprecated. Use the `interpolate` option instead. * @property {boolean} [interpolate=true] Use interpolated values when resampling. By default, * linear interpolation is used when resampling. Set to false to use the nearest neighbor instead. * @property {import("../proj.js").ProjectionLike} [projection] Projection. Default is the view projection. @@ -46,15 +45,9 @@ class Static extends ImageSource { ? options.imageLoadFunction : defaultImageLoadFunction; - let interpolate = - options.imageSmoothing !== undefined ? options.imageSmoothing : true; - if (options.interpolate !== undefined) { - interpolate = options.interpolate; - } - super({ attributions: options.attributions, - interpolate: interpolate, + interpolate: options.interpolate, projection: getProjection(options.projection), }); diff --git a/src/ol/source/ImageWMS.js b/src/ol/source/ImageWMS.js index 41f9552d35..37ebd6e53b 100644 --- a/src/ol/source/ImageWMS.js +++ b/src/ol/source/ImageWMS.js @@ -44,7 +44,6 @@ const GETFEATUREINFO_IMAGE_SIZE = [101, 101]; * the remote WMS server: `mapserver`, `geoserver`, `carmentaserver`, or `qgis`. * Only needed if `hidpi` is `true`. * @property {import("../Image.js").LoadFunction} [imageLoadFunction] Optional function to load an image given a URL. - * @property {boolean} [imageSmoothing=true] Deprecated. Use the `interpolate` option instead. * @property {boolean} [interpolate=true] Use interpolated values when resampling. By default, * linear interpolation is used when resampling. Set to false to use the nearest neighbor instead. * @property {Object} params WMS request parameters. @@ -74,15 +73,9 @@ class ImageWMS extends ImageSource { constructor(opt_options) { const options = opt_options ? opt_options : {}; - let interpolate = - options.imageSmoothing !== undefined ? options.imageSmoothing : true; - if (options.interpolate !== undefined) { - interpolate = options.interpolate; - } - super({ attributions: options.attributions, - interpolate: interpolate, + interpolate: options.interpolate, projection: options.projection, resolutions: options.resolutions, }); diff --git a/src/ol/source/OGCMapTile.js b/src/ol/source/OGCMapTile.js index 939ed7336b..cd0ef978d4 100644 --- a/src/ol/source/OGCMapTile.js +++ b/src/ol/source/OGCMapTile.js @@ -19,7 +19,6 @@ import {getTileSetInfo} from './ogcTileUtil.js'; * @property {null|string} [crossOrigin] The `crossOrigin` attribute for loaded images. Note that * you must provide a `crossOrigin` value if you want to access pixel data with the Canvas renderer. * See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail. - * @property {boolean} [imageSmoothing=true] Deprecated. Use the `interpolate` option instead. * @property {boolean} [interpolate=true] Use interpolated values when resampling. By default, * linear interpolation is used when resampling. Set to false to use the nearest neighbor instead. * @property {number} [reprojectionErrorThreshold=0.5] Maximum allowed reprojection error (in pixels). @@ -46,17 +45,11 @@ class OGCMapTile extends TileImage { * @param {Options} options OGC map tile options. */ constructor(options) { - let interpolate = - options.imageSmoothing !== undefined ? options.imageSmoothing : true; - if (options.interpolate !== undefined) { - interpolate = options.interpolate; - } - super({ attributions: options.attributions, cacheSize: options.cacheSize, crossOrigin: options.crossOrigin, - interpolate: interpolate, + interpolate: options.interpolate, projection: options.projection, reprojectionErrorThreshold: options.reprojectionErrorThreshold, state: 'loading', diff --git a/src/ol/source/OSM.js b/src/ol/source/OSM.js index 91d3907c92..646dd6c5da 100644 --- a/src/ol/source/OSM.js +++ b/src/ol/source/OSM.js @@ -23,7 +23,6 @@ export const ATTRIBUTION = * @property {null|string} [crossOrigin='anonymous'] The `crossOrigin` attribute for loaded images. Note that * you must provide a `crossOrigin` value if you want to access pixel data with the Canvas renderer. * See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail. - * @property {boolean} [imageSmoothing=true] Deprecated. Use the `interpolate` option instead. * @property {boolean} [interpolate=true] Use interpolated values when resampling. By default, * linear interpolation is used when resampling. Set to false to use the nearest neighbor instead. * @property {number} [maxZoom=19] Max zoom. @@ -58,12 +57,6 @@ class OSM extends XYZ { constructor(opt_options) { const options = opt_options || {}; - let interpolate = - options.imageSmoothing !== undefined ? options.imageSmoothing : true; - if (options.interpolate !== undefined) { - interpolate = options.interpolate; - } - let attributions; if (options.attributions !== undefined) { attributions = options.attributions; @@ -84,7 +77,7 @@ class OSM extends XYZ { attributionsCollapsible: false, cacheSize: options.cacheSize, crossOrigin: crossOrigin, - interpolate: interpolate, + interpolate: options.interpolate, maxZoom: options.maxZoom !== undefined ? options.maxZoom : 19, opaque: options.opaque !== undefined ? options.opaque : true, reprojectionErrorThreshold: options.reprojectionErrorThreshold, diff --git a/src/ol/source/Stamen.js b/src/ol/source/Stamen.js index ba42733f91..a049547f45 100644 --- a/src/ol/source/Stamen.js +++ b/src/ol/source/Stamen.js @@ -87,7 +87,6 @@ const ProviderConfig = { /** * @typedef {Object} Options * @property {number} [cacheSize] Initial tile cache size. Will auto-grow to hold at least the number of tiles in the viewport. - * @property {boolean} [imageSmoothing=true] Deprecated. Use the `interpolate` option instead. * @property {boolean} [interpolate=true] Use interpolated values when resampling. By default, * linear interpolation is used when resampling. Set to false to use the nearest neighbor instead. * @property {string} layer Layer name. @@ -121,12 +120,6 @@ class Stamen extends XYZ { * @param {Options} options Stamen options. */ constructor(options) { - let interpolate = - options.imageSmoothing !== undefined ? options.imageSmoothing : true; - if (options.interpolate !== undefined) { - interpolate = options.interpolate; - } - const i = options.layer.indexOf('-'); const provider = i == -1 ? options.layer : options.layer.slice(0, i); const providerConfig = ProviderConfig[provider]; @@ -145,7 +138,7 @@ class Stamen extends XYZ { attributions: ATTRIBUTIONS, cacheSize: options.cacheSize, crossOrigin: 'anonymous', - interpolate: interpolate, + interpolate: options.interpolate, maxZoom: options.maxZoom != undefined ? options.maxZoom : providerConfig.maxZoom, minZoom: diff --git a/src/ol/source/TileArcGISRest.js b/src/ol/source/TileArcGISRest.js index 091d54c538..3cebbffee3 100644 --- a/src/ol/source/TileArcGISRest.js +++ b/src/ol/source/TileArcGISRest.js @@ -16,7 +16,6 @@ import {hash as tileCoordHash} from '../tilecoord.js'; * @property {null|string} [crossOrigin] The `crossOrigin` attribute for loaded images. Note that * you must provide a `crossOrigin` value if you want to access pixel data with the Canvas renderer. * See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail. - * @property {boolean} [imageSmoothing=true] Deprecated. Use the `interpolate` option instead. * @property {boolean} [interpolate=true] Use interpolated values when resampling. By default, * linear interpolation is used when resampling. Set to false to use the nearest neighbor instead. * @property {Object} [params] ArcGIS Rest parameters. This field is optional. Service defaults will be @@ -73,17 +72,11 @@ class TileArcGISRest extends TileImage { constructor(opt_options) { const options = opt_options ? opt_options : {}; - let interpolate = - options.imageSmoothing !== undefined ? options.imageSmoothing : true; - if (options.interpolate !== undefined) { - interpolate = options.interpolate; - } - super({ attributions: options.attributions, cacheSize: options.cacheSize, crossOrigin: options.crossOrigin, - interpolate: interpolate, + interpolate: options.interpolate, projection: options.projection, reprojectionErrorThreshold: options.reprojectionErrorThreshold, tileGrid: options.tileGrid, diff --git a/src/ol/source/TileImage.js b/src/ol/source/TileImage.js index 82fdaa0e21..766a869508 100644 --- a/src/ol/source/TileImage.js +++ b/src/ol/source/TileImage.js @@ -21,7 +21,6 @@ import {getUid} from '../util.js'; * @property {null|string} [crossOrigin] The `crossOrigin` attribute for loaded images. Note that * you must provide a `crossOrigin` value if you want to access pixel data with the Canvas renderer. * See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail. - * @property {boolean} [imageSmoothing=true] Deprecated. Use the `interpolate` option instead. * @property {boolean} [interpolate=true] Use interpolated values when resampling. By default, * linear interpolation is used when resampling. Set to false to use the nearest neighbor instead. * @property {boolean} [opaque=false] Whether the layer is opaque. @@ -71,12 +70,6 @@ class TileImage extends UrlTile { * @param {!Options} options Image tile options. */ constructor(options) { - let interpolate = - options.imageSmoothing !== undefined ? options.imageSmoothing : true; - if (options.interpolate !== undefined) { - interpolate = options.interpolate; - } - super({ attributions: options.attributions, cacheSize: options.cacheSize, @@ -93,7 +86,8 @@ class TileImage extends UrlTile { urls: options.urls, wrapX: options.wrapX, transition: options.transition, - interpolate: interpolate, + interpolate: + options.interpolate !== undefined ? options.interpolate : true, key: options.key, attributionsCollapsible: options.attributionsCollapsible, zDirection: options.zDirection, diff --git a/src/ol/source/TileJSON.js b/src/ol/source/TileJSON.js index 3d0dfcb40e..6f16c91cd6 100644 --- a/src/ol/source/TileJSON.js +++ b/src/ol/source/TileJSON.js @@ -39,7 +39,6 @@ import {jsonp as requestJSONP} from '../net.js'; * @property {null|string} [crossOrigin] The `crossOrigin` attribute for loaded images. Note that * you must provide a `crossOrigin` value if you want to access pixel data with the Canvas renderer. * See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail. - * @property {boolean} [imageSmoothing=true] Deprecated. Use the `interpolate` option instead. * @property {boolean} [interpolate=true] Use interpolated values when resampling. By default, * linear interpolation is used when resampling. Set to false to use the nearest neighbor instead. * @property {boolean} [jsonp=false] Use JSONP with callback to load the TileJSON. @@ -75,17 +74,11 @@ class TileJSON extends TileImage { * @param {Options} options TileJSON options. */ constructor(options) { - let interpolate = - options.imageSmoothing !== undefined ? options.imageSmoothing : true; - if (options.interpolate !== undefined) { - interpolate = options.interpolate; - } - super({ attributions: options.attributions, cacheSize: options.cacheSize, crossOrigin: options.crossOrigin, - interpolate: interpolate, + interpolate: options.interpolate, projection: getProjection('EPSG:3857'), reprojectionErrorThreshold: options.reprojectionErrorThreshold, state: 'loading', diff --git a/src/ol/source/TileWMS.js b/src/ol/source/TileWMS.js index 82ea2cdfa1..0e5774ce2f 100644 --- a/src/ol/source/TileWMS.js +++ b/src/ol/source/TileWMS.js @@ -22,7 +22,6 @@ import {hash as tileCoordHash} from '../tilecoord.js'; * @property {null|string} [crossOrigin] The `crossOrigin` attribute for loaded images. Note that * you must provide a `crossOrigin` value if you want to access pixel data with the Canvas renderer. * See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail. - * @property {boolean} [imageSmoothing=true] Deprecated. Use the `interpolate` option instead. * @property {boolean} [interpolate=true] Use interpolated values when resampling. By default, * linear interpolation is used when resampling. Set to false to use the nearest neighbor instead. * @property {Object} params WMS request parameters. @@ -85,12 +84,6 @@ class TileWMS extends TileImage { constructor(opt_options) { const options = opt_options ? opt_options : /** @type {Options} */ ({}); - let interpolate = - options.imageSmoothing !== undefined ? options.imageSmoothing : true; - if (options.interpolate !== undefined) { - interpolate = options.interpolate; - } - const params = options.params || {}; const transparent = 'TRANSPARENT' in params ? params['TRANSPARENT'] : true; @@ -100,7 +93,7 @@ class TileWMS extends TileImage { attributionsCollapsible: options.attributionsCollapsible, cacheSize: options.cacheSize, crossOrigin: options.crossOrigin, - interpolate: interpolate, + interpolate: options.interpolate, opaque: !transparent, projection: options.projection, reprojectionErrorThreshold: options.reprojectionErrorThreshold, diff --git a/src/ol/source/WMTS.js b/src/ol/source/WMTS.js index a43d7ab542..abf4c0b7b5 100644 --- a/src/ol/source/WMTS.js +++ b/src/ol/source/WMTS.js @@ -22,7 +22,6 @@ import {equivalent, get as getProjection, transformExtent} from '../proj.js'; * @property {null|string} [crossOrigin] The `crossOrigin` attribute for loaded images. Note that * you must provide a `crossOrigin` value if you want to access pixel data with the Canvas renderer. * See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail. - * @property {boolean} [imageSmoothing=true] Deprecated. Use the `interpolate` option instead. * @property {boolean} [interpolate=true] Use interpolated values when resampling. By default, * linear interpolation is used when resampling. Set to false to use the nearest neighbor instead. * @property {import("../tilegrid/WMTS.js").default} tileGrid Tile grid. @@ -73,12 +72,6 @@ class WMTS extends TileImage { * @param {Options} options WMTS options. */ constructor(options) { - let interpolate = - options.imageSmoothing !== undefined ? options.imageSmoothing : true; - if (options.interpolate !== undefined) { - interpolate = options.interpolate; - } - // TODO: add support for TileMatrixLimits const requestEncoding = @@ -98,7 +91,7 @@ class WMTS extends TileImage { attributionsCollapsible: options.attributionsCollapsible, cacheSize: options.cacheSize, crossOrigin: options.crossOrigin, - interpolate: interpolate, + interpolate: options.interpolate, projection: options.projection, reprojectionErrorThreshold: options.reprojectionErrorThreshold, tileClass: options.tileClass, diff --git a/src/ol/source/XYZ.js b/src/ol/source/XYZ.js index 4bf7e73f6d..bcf02588db 100644 --- a/src/ol/source/XYZ.js +++ b/src/ol/source/XYZ.js @@ -13,7 +13,6 @@ import {createXYZ, extentFromProjection} from '../tilegrid.js'; * @property {null|string} [crossOrigin] The `crossOrigin` attribute for loaded images. Note that * you must provide a `crossOrigin` value if you want to access pixel data with the Canvas renderer. * See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail. - * @property {boolean} [imageSmoothing=true] Deprecated. Use the `interpolate` option instead. * @property {boolean} [interpolate=true] Use interpolated values when resampling. By default, * linear interpolation is used when resampling. Set to false to use the nearest neighbor instead. * @property {boolean} [opaque=false] Whether the layer is opaque. @@ -78,12 +77,6 @@ class XYZ extends TileImage { constructor(opt_options) { const options = opt_options || {}; - let interpolate = - options.imageSmoothing !== undefined ? options.imageSmoothing : true; - if (options.interpolate !== undefined) { - interpolate = options.interpolate; - } - const projection = options.projection !== undefined ? options.projection : 'EPSG:3857'; @@ -102,7 +95,7 @@ class XYZ extends TileImage { attributions: options.attributions, cacheSize: options.cacheSize, crossOrigin: options.crossOrigin, - interpolate: interpolate, + interpolate: options.interpolate, opaque: options.opaque, projection: projection, reprojectionErrorThreshold: options.reprojectionErrorThreshold, diff --git a/src/ol/source/Zoomify.js b/src/ol/source/Zoomify.js index d3212abbe2..247d8ef80e 100644 --- a/src/ol/source/Zoomify.js +++ b/src/ol/source/Zoomify.js @@ -83,7 +83,6 @@ export class CustomTile extends ImageTile { * @property {null|string} [crossOrigin] The `crossOrigin` attribute for loaded images. Note that * you must provide a `crossOrigin` value you want to access pixel data with the Canvas renderer. * See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail. - * @property {boolean} [imageSmoothing=true] Deprecated. Use the `interpolate` option instead. * @property {boolean} [interpolate=true] Use interpolated values when resampling. By default, * linear interpolation is used when resampling. Set to false to use the nearest neighbor instead. * @property {import("../proj.js").ProjectionLike} [projection] Projection. @@ -129,12 +128,6 @@ class Zoomify extends TileImage { constructor(opt_options) { const options = opt_options; - let interpolate = - options.imageSmoothing !== undefined ? options.imageSmoothing : true; - if (options.interpolate !== undefined) { - interpolate = options.interpolate; - } - const size = options.size; const tierSizeCalculation = options.tierSizeCalculation !== undefined @@ -264,7 +257,7 @@ class Zoomify extends TileImage { attributions: options.attributions, cacheSize: options.cacheSize, crossOrigin: options.crossOrigin, - interpolate: interpolate, + interpolate: options.interpolate, projection: options.projection, tilePixelRatio: tilePixelRatio, reprojectionErrorThreshold: options.reprojectionErrorThreshold, diff --git a/test/browser/spec/ol/source/BingMaps.test.js b/test/browser/spec/ol/source/BingMaps.test.js index 7195e825a1..6c5cd5a828 100644 --- a/test/browser/spec/ol/source/BingMaps.test.js +++ b/test/browser/spec/ol/source/BingMaps.test.js @@ -20,11 +20,6 @@ describe('ol/source/BingMaps', function () { const source = new BingMaps({interpolate: false}); expect(source.getInterpolate()).to.be(false); }); - - it('is false if constructed with imageSmoothing: false', function () { - const source = new BingMaps({imageSmoothing: false}); - expect(source.getInterpolate()).to.be(false); - }); }); describe('#tileUrlFunction()', function () { diff --git a/test/browser/spec/ol/source/IIIF.test.js b/test/browser/spec/ol/source/IIIF.test.js index 5f3d2f3297..2227f03262 100644 --- a/test/browser/spec/ol/source/IIIF.test.js +++ b/test/browser/spec/ol/source/IIIF.test.js @@ -151,11 +151,6 @@ describe('ol/source/IIIF', function () { const source = new IIIF({size: size, interpolate: false}); expect(source.getInterpolate()).to.be(false); }); - - it('is false if constructed with imageSmoothing: false', function () { - const source = new IIIF({size: size, imageSmoothing: false}); - expect(source.getInterpolate()).to.be(false); - }); }); describe('tileUrlFunction', function () { diff --git a/test/browser/spec/ol/source/ImageArcGISRest.test.js b/test/browser/spec/ol/source/ImageArcGISRest.test.js index b826617f0d..03001410e8 100644 --- a/test/browser/spec/ol/source/ImageArcGISRest.test.js +++ b/test/browser/spec/ol/source/ImageArcGISRest.test.js @@ -26,13 +26,6 @@ describe('ol/source/ImageArcGISRest', function () { ); expect(source.getInterpolate()).to.be(false); }); - - it('is false if constructed with imageSmoothing: false', function () { - const source = new ImageArcGISRest( - Object.assign({imageSmoothing: false}, options) - ); - expect(source.getInterpolate()).to.be(false); - }); }); describe('#getImage', function () { diff --git a/test/browser/spec/ol/source/ImageStatic.test.js b/test/browser/spec/ol/source/ImageStatic.test.js index ffd415a198..09f8ce2587 100644 --- a/test/browser/spec/ol/source/ImageStatic.test.js +++ b/test/browser/spec/ol/source/ImageStatic.test.js @@ -23,11 +23,6 @@ describe('ol/source/ImageStatic', function () { const source = new Static({interpolate: false}); expect(source.getInterpolate()).to.be(false); }); - - it('is false if constructed with imageSmoothing: false', function () { - const source = new Static({imageSmoothing: false}); - expect(source.getInterpolate()).to.be(false); - }); }); describe('#getImage', function () { diff --git a/test/browser/spec/ol/source/TileImage.test.js b/test/browser/spec/ol/source/TileImage.test.js index 7463919c12..beeff1ae8b 100644 --- a/test/browser/spec/ol/source/TileImage.test.js +++ b/test/browser/spec/ol/source/TileImage.test.js @@ -41,11 +41,6 @@ describe('ol/source/TileImage', function () { const source = new TileImage({interpolate: false}); expect(source.getInterpolate()).to.be(false); }); - - it('is false if constructed with imageSmoothing: false', function () { - const source = new TileImage({imageSmoothing: false}); - expect(source.getInterpolate()).to.be(false); - }); }); describe('#getTileCacheForProjection', function () { diff --git a/test/browser/spec/ol/source/TileJSON.test.js b/test/browser/spec/ol/source/TileJSON.test.js index 0ad44a6355..e8f00f7216 100644 --- a/test/browser/spec/ol/source/TileJSON.test.js +++ b/test/browser/spec/ol/source/TileJSON.test.js @@ -27,14 +27,6 @@ describe('ol/source/TileJSON', function () { }); expect(source.getInterpolate()).to.be(false); }); - - it('is false if constructed with imageSmoothing: false', function () { - const source = new TileJSON({ - imageSmoothing: false, - url: 'spec/ol/data/tilejson.json', - }); - expect(source.getInterpolate()).to.be(false); - }); }); describe('#getTileJSON', function () { diff --git a/test/browser/spec/ol/source/TileWMS.test.js b/test/browser/spec/ol/source/TileWMS.test.js index 1d3839afe4..f30dba1a0f 100644 --- a/test/browser/spec/ol/source/TileWMS.test.js +++ b/test/browser/spec/ol/source/TileWMS.test.js @@ -42,11 +42,6 @@ describe('ol/source/TileWMS', function () { const source = new TileWMS({interpolate: false}); expect(source.getInterpolate()).to.be(false); }); - - it('is false if constructed with imageSmoothing: false', function () { - const source = new TileWMS({imageSmoothing: false}); - expect(source.getInterpolate()).to.be(false); - }); }); describe('#getTile', function () { diff --git a/test/browser/spec/ol/source/WMTS.test.js b/test/browser/spec/ol/source/WMTS.test.js index 8104e51a2d..e3ea911167 100644 --- a/test/browser/spec/ol/source/WMTS.test.js +++ b/test/browser/spec/ol/source/WMTS.test.js @@ -240,11 +240,6 @@ describe('ol/source/WMTS', function () { const source = new WMTS({interpolate: false}); expect(source.getInterpolate()).to.be(false); }); - - it('is false if constructed with imageSmoothing: false', function () { - const source = new WMTS({imageSmoothing: false}); - expect(source.getInterpolate()).to.be(false); - }); }); describe('when creating tileUrlFunction', function () { diff --git a/test/browser/spec/ol/source/XYZ.test.js b/test/browser/spec/ol/source/XYZ.test.js index f689c1adbe..cd145c4fab 100644 --- a/test/browser/spec/ol/source/XYZ.test.js +++ b/test/browser/spec/ol/source/XYZ.test.js @@ -57,11 +57,6 @@ describe('ol/source/XYZ', function () { const source = new XYZ({interpolate: false}); expect(source.getInterpolate()).to.be(false); }); - - it('is false if constructed with imageSmoothing: false', function () { - const source = new XYZ({imageSmoothing: false}); - expect(source.getInterpolate()).to.be(false); - }); }); describe('tileUrlFunction', function () { diff --git a/test/browser/spec/ol/source/Zoomify.test.js b/test/browser/spec/ol/source/Zoomify.test.js index 3ef21a1ad5..1769ce78bd 100644 --- a/test/browser/spec/ol/source/Zoomify.test.js +++ b/test/browser/spec/ol/source/Zoomify.test.js @@ -151,15 +151,6 @@ describe('ol/source/Zoomify', function () { const source = new Zoomify({interpolate: false, url: '', size: [47, 11]}); expect(source.getInterpolate()).to.be(false); }); - - it('is false if constructed with imageSmoothing: false', function () { - const source = new Zoomify({ - imageSmoothing: false, - url: '', - size: [47, 11], - }); - expect(source.getInterpolate()).to.be(false); - }); }); describe('generated tileGrid', function () {