Rename _ol_reproj_Image_ to ReprojImage

This commit is contained in:
Tim Schaub
2018-01-11 10:27:16 -07:00
parent 5337dc31d9
commit 65d30f7ec0
4 changed files with 15 additions and 15 deletions
+9 -9
View File
@@ -26,7 +26,7 @@ import _ol_reproj_Triangulation_ from '../reproj/Triangulation.js';
* @param {ol.ReprojImageFunctionType} getImageFunction * @param {ol.ReprojImageFunctionType} getImageFunction
* Function returning source images (extent, resolution, pixelRatio). * Function returning source images (extent, resolution, pixelRatio).
*/ */
var _ol_reproj_Image_ = function(sourceProj, targetProj, var ReprojImage = function(sourceProj, targetProj,
targetExtent, targetResolution, pixelRatio, getImageFunction) { targetExtent, targetResolution, pixelRatio, getImageFunction) {
/** /**
@@ -109,13 +109,13 @@ var _ol_reproj_Image_ = function(sourceProj, targetProj,
_ol_ImageBase_.call(this, targetExtent, targetResolution, this.sourcePixelRatio_, state); _ol_ImageBase_.call(this, targetExtent, targetResolution, this.sourcePixelRatio_, state);
}; };
inherits(_ol_reproj_Image_, _ol_ImageBase_); inherits(ReprojImage, _ol_ImageBase_);
/** /**
* @inheritDoc * @inheritDoc
*/ */
_ol_reproj_Image_.prototype.disposeInternal = function() { ReprojImage.prototype.disposeInternal = function() {
if (this.state == ImageState.LOADING) { if (this.state == ImageState.LOADING) {
this.unlistenSource_(); this.unlistenSource_();
} }
@@ -126,7 +126,7 @@ _ol_reproj_Image_.prototype.disposeInternal = function() {
/** /**
* @inheritDoc * @inheritDoc
*/ */
_ol_reproj_Image_.prototype.getImage = function() { ReprojImage.prototype.getImage = function() {
return this.canvas_; return this.canvas_;
}; };
@@ -134,7 +134,7 @@ _ol_reproj_Image_.prototype.getImage = function() {
/** /**
* @return {ol.proj.Projection} Projection. * @return {ol.proj.Projection} Projection.
*/ */
_ol_reproj_Image_.prototype.getProjection = function() { ReprojImage.prototype.getProjection = function() {
return this.targetProj_; return this.targetProj_;
}; };
@@ -142,7 +142,7 @@ _ol_reproj_Image_.prototype.getProjection = function() {
/** /**
* @private * @private
*/ */
_ol_reproj_Image_.prototype.reproject_ = function() { ReprojImage.prototype.reproject_ = function() {
var sourceState = this.sourceImage_.getState(); var sourceState = this.sourceImage_.getState();
if (sourceState == ImageState.LOADED) { if (sourceState == ImageState.LOADED) {
var width = getWidth(this.targetExtent_) / this.targetResolution_; var width = getWidth(this.targetExtent_) / this.targetResolution_;
@@ -163,7 +163,7 @@ _ol_reproj_Image_.prototype.reproject_ = function() {
/** /**
* @inheritDoc * @inheritDoc
*/ */
_ol_reproj_Image_.prototype.load = function() { ReprojImage.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();
@@ -189,8 +189,8 @@ _ol_reproj_Image_.prototype.load = function() {
/** /**
* @private * @private
*/ */
_ol_reproj_Image_.prototype.unlistenSource_ = function() { ReprojImage.prototype.unlistenSource_ = function() {
_ol_events_.unlistenByKey(/** @type {!ol.EventsKey} */ (this.sourceListenerKey_)); _ol_events_.unlistenByKey(/** @type {!ol.EventsKey} */ (this.sourceListenerKey_));
this.sourceListenerKey_ = null; this.sourceListenerKey_ = null;
}; };
export default _ol_reproj_Image_; export default ReprojImage;
+2 -2
View File
@@ -8,7 +8,7 @@ import {linearFindNearest} from '../array.js';
import Event from '../events/Event.js'; import Event from '../events/Event.js';
import {equals} from '../extent.js'; import {equals} from '../extent.js';
import {equivalent} from '../proj.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'; import Source from '../source/Source.js';
/** /**
@@ -109,7 +109,7 @@ ImageSource.prototype.getImage = function(extent, resolution, pixelRatio, projec
this.reprojectedImage_ = null; this.reprojectedImage_ = null;
} }
this.reprojectedImage_ = new _ol_reproj_Image_( this.reprojectedImage_ = new ReprojImage(
sourceProjection, projection, extent, resolution, pixelRatio, sourceProjection, projection, extent, resolution, pixelRatio,
function(extent, resolution, pixelRatio) { function(extent, resolution, pixelRatio) {
return this.getImageInternal(extent, resolution, return this.getImageInternal(extent, resolution,
+2 -2
View File
@@ -1,7 +1,7 @@
import _ol_events_ from '../../../../src/ol/events.js'; import _ol_events_ from '../../../../src/ol/events.js';
import {get as getProjection} from '../../../../src/ol/proj.js'; import {get as getProjection} from '../../../../src/ol/proj.js';
import _ol_proj_EPSG3857_ from '../../../../src/ol/proj/EPSG3857.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 Static from '../../../../src/ol/source/ImageStatic.js';
import _ol_tilegrid_ from '../../../../src/ol/tilegrid.js'; import _ol_tilegrid_ from '../../../../src/ol/tilegrid.js';
@@ -14,7 +14,7 @@ describe('ol.rendering.reproj.Image', function() {
var imagesRequested = 0; var imagesRequested = 0;
var image = new _ol_reproj_Image_(sourceProj, getProjection(targetProj), var image = new ReprojImage(sourceProj, getProjection(targetProj),
targetExtent, targetResolution, pixelRatio, targetExtent, targetResolution, pixelRatio,
function(extent, resolution, pixelRatio) { function(extent, resolution, pixelRatio) {
imagesRequested++; imagesRequested++;
+2 -2
View File
@@ -1,12 +1,12 @@
import _ol_Image_ from '../../../../src/ol/Image.js'; import _ol_Image_ from '../../../../src/ol/Image.js';
import _ol_events_ from '../../../../src/ol/events.js'; import _ol_events_ from '../../../../src/ol/events.js';
import {get as getProjection} from '../../../../src/ol/proj.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() { describe('ol.reproj.Image', function() {
function createImage(pixelRatio) { function createImage(pixelRatio) {
return new _ol_reproj_Image_( return new ReprojImage(
getProjection('EPSG:3857'), getProjection('EPSG:4326'), getProjection('EPSG:3857'), getProjection('EPSG:4326'),
[-180, -85, 180, 85], 10, pixelRatio, [-180, -85, 180, 85], 10, pixelRatio,
function(extent, resolution, pixelRatio) { function(extent, resolution, pixelRatio) {