Rename _ol_ImageCanvas_ to ImageCanvas
This commit is contained in:
@@ -15,7 +15,7 @@ import ImageState from './ImageState.js';
|
|||||||
* @param {ol.ImageCanvasLoader=} opt_loader Optional loader function to
|
* @param {ol.ImageCanvasLoader=} opt_loader Optional loader function to
|
||||||
* support asynchronous canvas drawing.
|
* support asynchronous canvas drawing.
|
||||||
*/
|
*/
|
||||||
var _ol_ImageCanvas_ = function(extent, resolution, pixelRatio, canvas, opt_loader) {
|
var ImageCanvas = function(extent, resolution, pixelRatio, canvas, opt_loader) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Optional canvas loader function.
|
* Optional canvas loader function.
|
||||||
@@ -42,14 +42,14 @@ var _ol_ImageCanvas_ = function(extent, resolution, pixelRatio, canvas, opt_load
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
inherits(_ol_ImageCanvas_, _ol_ImageBase_);
|
inherits(ImageCanvas, _ol_ImageBase_);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get any error associated with asynchronous rendering.
|
* Get any error associated with asynchronous rendering.
|
||||||
* @return {Error} Any error that occurred during rendering.
|
* @return {Error} Any error that occurred during rendering.
|
||||||
*/
|
*/
|
||||||
_ol_ImageCanvas_.prototype.getError = function() {
|
ImageCanvas.prototype.getError = function() {
|
||||||
return this.error_;
|
return this.error_;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -59,7 +59,7 @@ _ol_ImageCanvas_.prototype.getError = function() {
|
|||||||
* @param {Error} err Any error during drawing.
|
* @param {Error} err Any error during drawing.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
_ol_ImageCanvas_.prototype.handleLoad_ = function(err) {
|
ImageCanvas.prototype.handleLoad_ = function(err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
this.error_ = err;
|
this.error_ = err;
|
||||||
this.state = ImageState.ERROR;
|
this.state = ImageState.ERROR;
|
||||||
@@ -73,7 +73,7 @@ _ol_ImageCanvas_.prototype.handleLoad_ = function(err) {
|
|||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
_ol_ImageCanvas_.prototype.load = function() {
|
ImageCanvas.prototype.load = function() {
|
||||||
if (this.state == ImageState.IDLE) {
|
if (this.state == ImageState.IDLE) {
|
||||||
this.state = ImageState.LOADING;
|
this.state = ImageState.LOADING;
|
||||||
this.changed();
|
this.changed();
|
||||||
@@ -85,7 +85,7 @@ _ol_ImageCanvas_.prototype.load = function() {
|
|||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
_ol_ImageCanvas_.prototype.getImage = function() {
|
ImageCanvas.prototype.getImage = function() {
|
||||||
return this.canvas_;
|
return this.canvas_;
|
||||||
};
|
};
|
||||||
export default _ol_ImageCanvas_;
|
export default ImageCanvas;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
*/
|
*/
|
||||||
import {ENABLE_RASTER_REPROJECTION} from '../../reproj/common.js';
|
import {ENABLE_RASTER_REPROJECTION} from '../../reproj/common.js';
|
||||||
import {inherits} from '../../index.js';
|
import {inherits} from '../../index.js';
|
||||||
import _ol_ImageCanvas_ from '../../ImageCanvas.js';
|
import ImageCanvas from '../../ImageCanvas.js';
|
||||||
import LayerType from '../../LayerType.js';
|
import LayerType from '../../LayerType.js';
|
||||||
import ViewHint from '../../ViewHint.js';
|
import ViewHint from '../../ViewHint.js';
|
||||||
import {equals} from '../../array.js';
|
import {equals} from '../../array.js';
|
||||||
@@ -153,7 +153,7 @@ CanvasImageLayerRenderer.prototype.prepareFrame = function(frameState, layerStat
|
|||||||
context.canvas.width = imageFrameState.size[0] * pixelRatio;
|
context.canvas.width = imageFrameState.size[0] * pixelRatio;
|
||||||
context.canvas.height = imageFrameState.size[1] * pixelRatio;
|
context.canvas.height = imageFrameState.size[1] * pixelRatio;
|
||||||
vectorRenderer.composeFrame(imageFrameState, layerState, context);
|
vectorRenderer.composeFrame(imageFrameState, layerState, context);
|
||||||
this.image_ = new _ol_ImageCanvas_(renderedExtent, viewResolution, pixelRatio, context.canvas);
|
this.image_ = new ImageCanvas(renderedExtent, viewResolution, pixelRatio, context.canvas);
|
||||||
this.skippedFeatures_ = skippedFeatures;
|
this.skippedFeatures_ = skippedFeatures;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @module ol/source/ImageCanvas
|
* @module ol/source/ImageCanvas
|
||||||
*/
|
*/
|
||||||
import {inherits} from '../index.js';
|
import {inherits} from '../index.js';
|
||||||
import _ol_ImageCanvas_ from '../ImageCanvas.js';
|
import ImageCanvas from '../ImageCanvas.js';
|
||||||
import {containsExtent, getHeight, getWidth, scaleFromCenter} from '../extent.js';
|
import {containsExtent, getHeight, getWidth, scaleFromCenter} from '../extent.js';
|
||||||
import ImageSource from '../source/Image.js';
|
import ImageSource from '../source/Image.js';
|
||||||
|
|
||||||
@@ -78,7 +78,7 @@ _ol_source_ImageCanvas_.prototype.getImageInternal = function(extent, resolution
|
|||||||
var canvasElement = this.canvasFunction_(
|
var canvasElement = this.canvasFunction_(
|
||||||
extent, resolution, pixelRatio, size, projection);
|
extent, resolution, pixelRatio, size, projection);
|
||||||
if (canvasElement) {
|
if (canvasElement) {
|
||||||
canvas = new _ol_ImageCanvas_(extent, resolution, pixelRatio, canvasElement);
|
canvas = new ImageCanvas(extent, resolution, pixelRatio, canvasElement);
|
||||||
}
|
}
|
||||||
this.canvas_ = canvas;
|
this.canvas_ = canvas;
|
||||||
this.renderedRevision_ = this.getRevision();
|
this.renderedRevision_ = this.getRevision();
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @module ol/source/Raster
|
* @module ol/source/Raster
|
||||||
*/
|
*/
|
||||||
import {getUid, inherits} from '../index.js';
|
import {getUid, inherits} from '../index.js';
|
||||||
import _ol_ImageCanvas_ from '../ImageCanvas.js';
|
import ImageCanvas from '../ImageCanvas.js';
|
||||||
import TileQueue from '../TileQueue.js';
|
import TileQueue from '../TileQueue.js';
|
||||||
import {createCanvasContext2D} from '../dom.js';
|
import {createCanvasContext2D} from '../dom.js';
|
||||||
import _ol_events_ from '../events.js';
|
import _ol_events_ from '../events.js';
|
||||||
@@ -317,7 +317,7 @@ RasterSource.prototype.onWorkerComplete_ = function(frameState, err, output, dat
|
|||||||
var width = Math.round(getWidth(extent) / resolution);
|
var width = Math.round(getWidth(extent) / resolution);
|
||||||
var height = Math.round(getHeight(extent) / resolution);
|
var height = Math.round(getHeight(extent) / resolution);
|
||||||
context = createCanvasContext2D(width, height);
|
context = createCanvasContext2D(width, height);
|
||||||
this.renderedImageCanvas_ = new _ol_ImageCanvas_(extent, resolution, 1, context.canvas);
|
this.renderedImageCanvas_ = new ImageCanvas(extent, resolution, 1, context.canvas);
|
||||||
}
|
}
|
||||||
context.putImageData(output, 0, 0);
|
context.putImageData(output, 0, 0);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user