add Image source imageSmoothing option
Add Image smoothing checkbox to example Test imageSmoothing option
This commit is contained in:
+18
-1
@@ -6,6 +6,7 @@ import ImageState from '../ImageState.js';
|
||||
import ReprojImage from '../reproj/Image.js';
|
||||
import Source from './Source.js';
|
||||
import {ENABLE_RASTER_REPROJECTION} from '../reproj/common.js';
|
||||
import {IMAGE_SMOOTHING_DISABLED} from './common.js';
|
||||
import {abstract} from '../util.js';
|
||||
import {equals} from '../extent.js';
|
||||
import {equivalent} from '../proj.js';
|
||||
@@ -62,6 +63,7 @@ export class ImageSourceEvent extends Event {
|
||||
/**
|
||||
* @typedef {Object} Options
|
||||
* @property {import("./Source.js").AttributionLike} [attributions]
|
||||
* @property {boolean} [imageSmoothing=true] Enable image smoothing.
|
||||
* @property {import("../proj.js").ProjectionLike} [projection]
|
||||
* @property {Array<number>} [resolutions]
|
||||
* @property {import("./State.js").default} [state]
|
||||
@@ -105,6 +107,13 @@ class ImageSource extends Source {
|
||||
* @type {number}
|
||||
*/
|
||||
this.reprojectedRevision_ = 0;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {object|undefined}
|
||||
*/
|
||||
this.contextOptions_ =
|
||||
options.imageSmoothing === false ? IMAGE_SMOOTHING_DISABLED : undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -114,6 +123,13 @@ class ImageSource extends Source {
|
||||
return this.resolutions_;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {Object|undefined} Context options.
|
||||
*/
|
||||
getContextOptions() {
|
||||
return this.contextOptions_;
|
||||
}
|
||||
|
||||
/**
|
||||
* @protected
|
||||
* @param {number} resolution Resolution.
|
||||
@@ -173,7 +189,8 @@ class ImageSource extends Source {
|
||||
pixelRatio,
|
||||
sourceProjection
|
||||
);
|
||||
}.bind(this)
|
||||
}.bind(this),
|
||||
this.contextOptions_
|
||||
);
|
||||
this.reprojectedRevision_ = this.getRevision();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user