Rename _ol_reproj_Tile_ to ReprojTile
This commit is contained in:
@@ -32,7 +32,7 @@ import _ol_reproj_Triangulation_ from '../reproj/Triangulation.js';
|
||||
* @param {number=} opt_errorThreshold Acceptable reprojection error (in px).
|
||||
* @param {boolean=} opt_renderEdges Render reprojection edges.
|
||||
*/
|
||||
var _ol_reproj_Tile_ = function(sourceProj, sourceTileGrid,
|
||||
var ReprojTile = function(sourceProj, sourceTileGrid,
|
||||
targetProj, targetTileGrid, tileCoord, wrappedTileCoord,
|
||||
pixelRatio, gutter, getTileFunction,
|
||||
opt_errorThreshold, opt_renderEdges) {
|
||||
@@ -187,13 +187,13 @@ var _ol_reproj_Tile_ = function(sourceProj, sourceTileGrid,
|
||||
}
|
||||
};
|
||||
|
||||
inherits(_ol_reproj_Tile_, _ol_Tile_);
|
||||
inherits(ReprojTile, _ol_Tile_);
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_reproj_Tile_.prototype.disposeInternal = function() {
|
||||
ReprojTile.prototype.disposeInternal = function() {
|
||||
if (this.state == TileState.LOADING) {
|
||||
this.unlistenSources_();
|
||||
}
|
||||
@@ -205,7 +205,7 @@ _ol_reproj_Tile_.prototype.disposeInternal = function() {
|
||||
* Get the HTML Canvas element for this tile.
|
||||
* @return {HTMLCanvasElement} Canvas.
|
||||
*/
|
||||
_ol_reproj_Tile_.prototype.getImage = function() {
|
||||
ReprojTile.prototype.getImage = function() {
|
||||
return this.canvas_;
|
||||
};
|
||||
|
||||
@@ -213,7 +213,7 @@ _ol_reproj_Tile_.prototype.getImage = function() {
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
_ol_reproj_Tile_.prototype.reproject_ = function() {
|
||||
ReprojTile.prototype.reproject_ = function() {
|
||||
var sources = [];
|
||||
this.sourceTiles_.forEach(function(tile, i, arr) {
|
||||
if (tile && tile.getState() == TileState.LOADED) {
|
||||
@@ -251,7 +251,7 @@ _ol_reproj_Tile_.prototype.reproject_ = function() {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_reproj_Tile_.prototype.load = function() {
|
||||
ReprojTile.prototype.load = function() {
|
||||
if (this.state == TileState.IDLE) {
|
||||
this.state = TileState.LOADING;
|
||||
this.changed();
|
||||
@@ -300,8 +300,8 @@ _ol_reproj_Tile_.prototype.load = function() {
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
_ol_reproj_Tile_.prototype.unlistenSources_ = function() {
|
||||
ReprojTile.prototype.unlistenSources_ = function() {
|
||||
this.sourcesListenerKeys_.forEach(_ol_events_.unlistenByKey);
|
||||
this.sourcesListenerKeys_ = null;
|
||||
};
|
||||
export default _ol_reproj_Tile_;
|
||||
export default ReprojTile;
|
||||
|
||||
@@ -9,7 +9,7 @@ import TileState from '../TileState.js';
|
||||
import _ol_events_ from '../events.js';
|
||||
import EventType from '../events/EventType.js';
|
||||
import {equivalent, get as getProjection} from '../proj.js';
|
||||
import _ol_reproj_Tile_ from '../reproj/Tile.js';
|
||||
import ReprojTile from '../reproj/Tile.js';
|
||||
import UrlTile from '../source/UrlTile.js';
|
||||
import _ol_tilecoord_ from '../tilecoord.js';
|
||||
import _ol_tilegrid_ from '../tilegrid.js';
|
||||
@@ -254,7 +254,7 @@ TileImage.prototype.getTile = function(z, x, y, pixelRatio, projection) {
|
||||
var targetTileGrid = this.getTileGridForProjection(projection);
|
||||
var wrappedTileCoord =
|
||||
this.getTileCoordForTileUrlFunction(tileCoord, projection);
|
||||
var newTile = new _ol_reproj_Tile_(
|
||||
var newTile = new ReprojTile(
|
||||
sourceProjection, sourceTileGrid,
|
||||
projection, targetTileGrid,
|
||||
tileCoord, wrappedTileCoord, this.getTilePixelRatio(pixelRatio),
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import TileState from '../../../../src/ol/TileState.js';
|
||||
import _ol_events_ from '../../../../src/ol/events.js';
|
||||
import {get as getProjection} from '../../../../src/ol/proj.js';
|
||||
import _ol_reproj_Tile_ from '../../../../src/ol/reproj/Tile.js';
|
||||
import ReprojTile from '../../../../src/ol/reproj/Tile.js';
|
||||
import XYZ from '../../../../src/ol/source/XYZ.js';
|
||||
import _ol_tilegrid_ from '../../../../src/ol/tilegrid.js';
|
||||
import {register} from '../../../../src/ol/proj/proj4.js';
|
||||
@@ -16,7 +16,7 @@ describe('ol.rendering.reproj.Tile', function() {
|
||||
|
||||
var tilesRequested = 0;
|
||||
|
||||
var tile = new _ol_reproj_Tile_(sourceProjection, source.getTileGrid(),
|
||||
var tile = new ReprojTile(sourceProjection, source.getTileGrid(),
|
||||
getProjection(targetProjection), targetTileGrid,
|
||||
[z, x, y], null, pixelRatio, sourceGutter,
|
||||
function(z, x, y, pixelRatio) {
|
||||
|
||||
@@ -2,7 +2,7 @@ import ImageTile from '../../../../src/ol/ImageTile.js';
|
||||
import _ol_events_ from '../../../../src/ol/events.js';
|
||||
import {addCommon, clearAllProjections, get as getProjection} from '../../../../src/ol/proj.js';
|
||||
import {register} from '../../../../src/ol/proj/proj4.js';
|
||||
import _ol_reproj_Tile_ from '../../../../src/ol/reproj/Tile.js';
|
||||
import ReprojTile from '../../../../src/ol/reproj/Tile.js';
|
||||
import _ol_tilegrid_ from '../../../../src/ol/tilegrid.js';
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ describe('ol.reproj.Tile', function() {
|
||||
function createTile(pixelRatio, opt_tileSize) {
|
||||
var proj4326 = getProjection('EPSG:4326');
|
||||
var proj3857 = getProjection('EPSG:3857');
|
||||
return new _ol_reproj_Tile_(
|
||||
return new ReprojTile(
|
||||
proj3857, _ol_tilegrid_.createForProjection(proj3857), proj4326,
|
||||
_ol_tilegrid_.createForProjection(proj4326, 3, opt_tileSize),
|
||||
[3, 2, -2], null, pixelRatio, 0, function(z, x, y, pixelRatio) {
|
||||
@@ -54,7 +54,7 @@ describe('ol.reproj.Tile', function() {
|
||||
it('is empty when outside target tile grid', function() {
|
||||
var proj4326 = getProjection('EPSG:4326');
|
||||
var proj3857 = getProjection('EPSG:3857');
|
||||
var tile = new _ol_reproj_Tile_(
|
||||
var tile = new ReprojTile(
|
||||
proj3857, _ol_tilegrid_.createForProjection(proj3857),
|
||||
proj4326, _ol_tilegrid_.createForProjection(proj4326),
|
||||
[0, -1, 0], null, 1, 0, function() {
|
||||
@@ -66,7 +66,7 @@ describe('ol.reproj.Tile', function() {
|
||||
it('is empty when outside source tile grid', function() {
|
||||
var proj4326 = getProjection('EPSG:4326');
|
||||
var proj27700 = getProjection('EPSG:27700');
|
||||
var tile = new _ol_reproj_Tile_(
|
||||
var tile = new ReprojTile(
|
||||
proj27700, _ol_tilegrid_.createForProjection(proj27700),
|
||||
proj4326, _ol_tilegrid_.createForProjection(proj4326),
|
||||
[3, 2, -2], null, 1, 0, function() {
|
||||
|
||||
@@ -6,7 +6,7 @@ import {addCommon, clearAllProjections, get as getProjection} from '../../../../
|
||||
import {register} from '../../../../src/ol/proj/proj4.js';
|
||||
import _ol_proj_EPSG3857_ from '../../../../src/ol/proj/EPSG3857.js';
|
||||
import _ol_proj_Projection_ from '../../../../src/ol/proj/Projection.js';
|
||||
import _ol_reproj_Tile_ from '../../../../src/ol/reproj/Tile.js';
|
||||
import ReprojTile from '../../../../src/ol/reproj/Tile.js';
|
||||
import TileImage from '../../../../src/ol/source/TileImage.js';
|
||||
import _ol_tilecoord_ from '../../../../src/ol/tilecoord.js';
|
||||
import _ol_tilegrid_ from '../../../../src/ol/tilegrid.js';
|
||||
@@ -117,7 +117,7 @@ describe('ol.source.TileImage', function() {
|
||||
var source3857 = createSource('EPSG:3857');
|
||||
var tile3857 = source3857.getTile(0, 0, -1, 1, getProjection('EPSG:3857'));
|
||||
expect(tile3857).to.be.a(ImageTile);
|
||||
expect(tile3857).not.to.be.a(_ol_reproj_Tile_);
|
||||
expect(tile3857).not.to.be.a(ReprojTile);
|
||||
|
||||
var projXXX = new _ol_proj_Projection_({
|
||||
code: 'XXX',
|
||||
@@ -126,7 +126,7 @@ describe('ol.source.TileImage', function() {
|
||||
var sourceXXX = createSource(projXXX);
|
||||
var tileXXX = sourceXXX.getTile(0, 0, -1, 1, projXXX);
|
||||
expect(tileXXX).to.be.a(ImageTile);
|
||||
expect(tileXXX).not.to.be.a(_ol_reproj_Tile_);
|
||||
expect(tileXXX).not.to.be.a(ReprojTile);
|
||||
});
|
||||
|
||||
beforeEach(function() {
|
||||
@@ -146,7 +146,7 @@ describe('ol.source.TileImage', function() {
|
||||
tileSize: [2, 2]
|
||||
}));
|
||||
var tile = source.getTile(0, 0, -1, 1, getProjection('EPSG:3857'));
|
||||
expect(tile).to.be.a(_ol_reproj_Tile_);
|
||||
expect(tile).to.be.a(ReprojTile);
|
||||
|
||||
_ol_events_.listen(tile, 'change', function() {
|
||||
if (tile.getState() == 2) { // LOADED
|
||||
@@ -165,7 +165,7 @@ describe('ol.source.TileImage', function() {
|
||||
tileSize: [2, 2]
|
||||
}));
|
||||
var tile = source.getTile(0, 0, -1, 1, proj);
|
||||
expect(tile).to.be.a(_ol_reproj_Tile_);
|
||||
expect(tile).to.be.a(ReprojTile);
|
||||
|
||||
_ol_events_.listen(tile, 'change', function() {
|
||||
if (tile.getState() == 2) { // LOADED
|
||||
|
||||
Reference in New Issue
Block a user