Deprecate the imageSmoothing option for sources

This commit is contained in:
Tim Schaub
2021-12-27 12:25:11 -07:00
parent 8d8632bff7
commit e2883fb658
48 changed files with 538 additions and 191 deletions
+10 -2
View File
@@ -87,7 +87,9 @@ 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] Enable image smoothing.
* @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.
* @property {number} [minZoom] Minimum zoom.
* @property {number} [maxZoom] Maximum zoom.
@@ -119,6 +121,12 @@ 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];
@@ -137,7 +145,7 @@ class Stamen extends XYZ {
attributions: ATTRIBUTIONS,
cacheSize: options.cacheSize,
crossOrigin: 'anonymous',
imageSmoothing: options.imageSmoothing,
interpolate: interpolate,
maxZoom:
options.maxZoom != undefined ? options.maxZoom : providerConfig.maxZoom,
minZoom: