Lint removal
This commit is contained in:
@@ -52,73 +52,73 @@ import ImageSource from '../source/Image.js';
|
||||
* @api
|
||||
*/
|
||||
class ImageCanvasSource {
|
||||
constructor(options) {
|
||||
constructor(options) {
|
||||
|
||||
ImageSource.call(this, {
|
||||
attributions: options.attributions,
|
||||
projection: options.projection,
|
||||
resolutions: options.resolutions,
|
||||
state: options.state
|
||||
});
|
||||
ImageSource.call(this, {
|
||||
attributions: options.attributions,
|
||||
projection: options.projection,
|
||||
resolutions: options.resolutions,
|
||||
state: options.state
|
||||
});
|
||||
|
||||
/**
|
||||
/**
|
||||
* @private
|
||||
* @type {module:ol/source/ImageCanvas~FunctionType}
|
||||
*/
|
||||
this.canvasFunction_ = options.canvasFunction;
|
||||
this.canvasFunction_ = options.canvasFunction;
|
||||
|
||||
/**
|
||||
/**
|
||||
* @private
|
||||
* @type {module:ol/ImageCanvas}
|
||||
*/
|
||||
this.canvas_ = null;
|
||||
this.canvas_ = null;
|
||||
|
||||
/**
|
||||
/**
|
||||
* @private
|
||||
* @type {number}
|
||||
*/
|
||||
this.renderedRevision_ = 0;
|
||||
this.renderedRevision_ = 0;
|
||||
|
||||
/**
|
||||
/**
|
||||
* @private
|
||||
* @type {number}
|
||||
*/
|
||||
this.ratio_ = options.ratio !== undefined ?
|
||||
options.ratio : 1.5;
|
||||
this.ratio_ = options.ratio !== undefined ?
|
||||
options.ratio : 1.5;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
getImageInternal(extent, resolution, pixelRatio, projection) {
|
||||
resolution = this.findNearestResolution(resolution);
|
||||
getImageInternal(extent, resolution, pixelRatio, projection) {
|
||||
resolution = this.findNearestResolution(resolution);
|
||||
|
||||
let canvas = this.canvas_;
|
||||
if (canvas &&
|
||||
let canvas = this.canvas_;
|
||||
if (canvas &&
|
||||
this.renderedRevision_ == this.getRevision() &&
|
||||
canvas.getResolution() == resolution &&
|
||||
canvas.getPixelRatio() == pixelRatio &&
|
||||
containsExtent(canvas.getExtent(), extent)) {
|
||||
return canvas;
|
||||
}
|
||||
return canvas;
|
||||
}
|
||||
|
||||
extent = extent.slice();
|
||||
scaleFromCenter(extent, this.ratio_);
|
||||
const width = getWidth(extent) / resolution;
|
||||
const height = getHeight(extent) / resolution;
|
||||
const size = [width * pixelRatio, height * pixelRatio];
|
||||
extent = extent.slice();
|
||||
scaleFromCenter(extent, this.ratio_);
|
||||
const width = getWidth(extent) / resolution;
|
||||
const height = getHeight(extent) / resolution;
|
||||
const size = [width * pixelRatio, height * pixelRatio];
|
||||
|
||||
const canvasElement = this.canvasFunction_(
|
||||
extent, resolution, pixelRatio, size, projection);
|
||||
if (canvasElement) {
|
||||
canvas = new ImageCanvas(extent, resolution, pixelRatio, canvasElement);
|
||||
}
|
||||
this.canvas_ = canvas;
|
||||
this.renderedRevision_ = this.getRevision();
|
||||
const canvasElement = this.canvasFunction_(
|
||||
extent, resolution, pixelRatio, size, projection);
|
||||
if (canvasElement) {
|
||||
canvas = new ImageCanvas(extent, resolution, pixelRatio, canvasElement);
|
||||
}
|
||||
this.canvas_ = canvas;
|
||||
this.renderedRevision_ = this.getRevision();
|
||||
|
||||
return canvas;
|
||||
}
|
||||
return canvas;
|
||||
}
|
||||
}
|
||||
|
||||
inherits(ImageCanvasSource, ImageSource);
|
||||
|
||||
Reference in New Issue
Block a user