diff --git a/src/ol/reproj/Image.js b/src/ol/reproj/Image.js index a764964dda..e0ffc4265c 100644 --- a/src/ol/reproj/Image.js +++ b/src/ol/reproj/Image.js @@ -26,7 +26,7 @@ import _ol_reproj_Triangulation_ from '../reproj/Triangulation.js'; * @param {ol.ReprojImageFunctionType} getImageFunction * Function returning source images (extent, resolution, pixelRatio). */ -var _ol_reproj_Image_ = function(sourceProj, targetProj, +var ReprojImage = function(sourceProj, targetProj, targetExtent, targetResolution, pixelRatio, getImageFunction) { /** @@ -109,13 +109,13 @@ var _ol_reproj_Image_ = function(sourceProj, targetProj, _ol_ImageBase_.call(this, targetExtent, targetResolution, this.sourcePixelRatio_, state); }; -inherits(_ol_reproj_Image_, _ol_ImageBase_); +inherits(ReprojImage, _ol_ImageBase_); /** * @inheritDoc */ -_ol_reproj_Image_.prototype.disposeInternal = function() { +ReprojImage.prototype.disposeInternal = function() { if (this.state == ImageState.LOADING) { this.unlistenSource_(); } @@ -126,7 +126,7 @@ _ol_reproj_Image_.prototype.disposeInternal = function() { /** * @inheritDoc */ -_ol_reproj_Image_.prototype.getImage = function() { +ReprojImage.prototype.getImage = function() { return this.canvas_; }; @@ -134,7 +134,7 @@ _ol_reproj_Image_.prototype.getImage = function() { /** * @return {ol.proj.Projection} Projection. */ -_ol_reproj_Image_.prototype.getProjection = function() { +ReprojImage.prototype.getProjection = function() { return this.targetProj_; }; @@ -142,7 +142,7 @@ _ol_reproj_Image_.prototype.getProjection = function() { /** * @private */ -_ol_reproj_Image_.prototype.reproject_ = function() { +ReprojImage.prototype.reproject_ = function() { var sourceState = this.sourceImage_.getState(); if (sourceState == ImageState.LOADED) { var width = getWidth(this.targetExtent_) / this.targetResolution_; @@ -163,7 +163,7 @@ _ol_reproj_Image_.prototype.reproject_ = function() { /** * @inheritDoc */ -_ol_reproj_Image_.prototype.load = function() { +ReprojImage.prototype.load = function() { if (this.state == ImageState.IDLE) { this.state = ImageState.LOADING; this.changed(); @@ -189,8 +189,8 @@ _ol_reproj_Image_.prototype.load = function() { /** * @private */ -_ol_reproj_Image_.prototype.unlistenSource_ = function() { +ReprojImage.prototype.unlistenSource_ = function() { _ol_events_.unlistenByKey(/** @type {!ol.EventsKey} */ (this.sourceListenerKey_)); this.sourceListenerKey_ = null; }; -export default _ol_reproj_Image_; +export default ReprojImage; diff --git a/src/ol/source/Image.js b/src/ol/source/Image.js index cf7e354042..c96e424092 100644 --- a/src/ol/source/Image.js +++ b/src/ol/source/Image.js @@ -8,7 +8,7 @@ import {linearFindNearest} from '../array.js'; import Event from '../events/Event.js'; import {equals} from '../extent.js'; import {equivalent} from '../proj.js'; -import _ol_reproj_Image_ from '../reproj/Image.js'; +import ReprojImage from '../reproj/Image.js'; import Source from '../source/Source.js'; /** @@ -109,7 +109,7 @@ ImageSource.prototype.getImage = function(extent, resolution, pixelRatio, projec this.reprojectedImage_ = null; } - this.reprojectedImage_ = new _ol_reproj_Image_( + this.reprojectedImage_ = new ReprojImage( sourceProjection, projection, extent, resolution, pixelRatio, function(extent, resolution, pixelRatio) { return this.getImageInternal(extent, resolution, diff --git a/test/rendering/ol/reproj/image.test.js b/test/rendering/ol/reproj/image.test.js index 86dcff2f1b..eb8b7fb916 100644 --- a/test/rendering/ol/reproj/image.test.js +++ b/test/rendering/ol/reproj/image.test.js @@ -1,7 +1,7 @@ import _ol_events_ from '../../../../src/ol/events.js'; import {get as getProjection} from '../../../../src/ol/proj.js'; import _ol_proj_EPSG3857_ from '../../../../src/ol/proj/EPSG3857.js'; -import _ol_reproj_Image_ from '../../../../src/ol/reproj/Image.js'; +import ReprojImage from '../../../../src/ol/reproj/Image.js'; import Static from '../../../../src/ol/source/ImageStatic.js'; import _ol_tilegrid_ from '../../../../src/ol/tilegrid.js'; @@ -14,7 +14,7 @@ describe('ol.rendering.reproj.Image', function() { var imagesRequested = 0; - var image = new _ol_reproj_Image_(sourceProj, getProjection(targetProj), + var image = new ReprojImage(sourceProj, getProjection(targetProj), targetExtent, targetResolution, pixelRatio, function(extent, resolution, pixelRatio) { imagesRequested++; diff --git a/test/spec/ol/reproj/image.test.js b/test/spec/ol/reproj/image.test.js index 76f908d31d..c5f11b7ab2 100644 --- a/test/spec/ol/reproj/image.test.js +++ b/test/spec/ol/reproj/image.test.js @@ -1,12 +1,12 @@ import _ol_Image_ from '../../../../src/ol/Image.js'; import _ol_events_ from '../../../../src/ol/events.js'; import {get as getProjection} from '../../../../src/ol/proj.js'; -import _ol_reproj_Image_ from '../../../../src/ol/reproj/Image.js'; +import ReprojImage from '../../../../src/ol/reproj/Image.js'; describe('ol.reproj.Image', function() { function createImage(pixelRatio) { - return new _ol_reproj_Image_( + return new ReprojImage( getProjection('EPSG:3857'), getProjection('EPSG:4326'), [-180, -85, 180, 85], 10, pixelRatio, function(extent, resolution, pixelRatio) {