Rename _ol_Tile_ to Tile

This commit is contained in:
Tim Schaub
2018-01-11 10:29:56 -07:00
parent 2efdf7982c
commit 1552f27a43
12 changed files with 60 additions and 60 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
import Map from '../../../../src/ol/Map.js';
import _ol_Tile_ from '../../../../src/ol/Tile.js';
import Tile from '../../../../src/ol/Tile.js';
import View from '../../../../src/ol/View.js';
import Attribution from '../../../../src/ol/control/Attribution.js';
import TileLayer from '../../../../src/ol/layer/Tile.js';
@@ -50,7 +50,7 @@ describe('ol.control.Attribution', function() {
map.getLayers().forEach(function(layer) {
var source = layer.getSource();
source.getTile = function() {
var tile = new _ol_Tile_([0, 0, -1], 2 /* LOADED */);
var tile = new Tile([0, 0, -1], 2 /* LOADED */);
tile.getImage = function() {
var image = new Image();
image.width = 256;
+7 -7
View File
@@ -1,5 +1,5 @@
import {inherits} from '../../../../src/ol/index.js';
import _ol_Tile_ from '../../../../src/ol/Tile.js';
import Tile from '../../../../src/ol/Tile.js';
import TileRange from '../../../../src/ol/TileRange.js';
import {get as getProjection} from '../../../../src/ol/proj.js';
import _ol_proj_Projection_ from '../../../../src/ol/proj/Projection.js';
@@ -31,7 +31,7 @@ var MockTile = function(tileStates) {
});
for (var key in tileStates) {
this.tileCache.set(key, new _ol_Tile_(key.split('/'), tileStates[key]));
this.tileCache.set(key, new Tile(key.split('/'), tileStates[key]));
}
};
@@ -46,7 +46,7 @@ MockTile.prototype.getTile = function(z, x, y) {
if (this.tileCache.containsKey(key)) {
return /** @type {!ol.Tile} */ (this.tileCache.get(key));
} else {
var tile = new _ol_Tile_(key, 0); // IDLE
var tile = new Tile(key, 0); // IDLE
this.tileCache.set(key, tile);
return tile;
}
@@ -279,7 +279,7 @@ describe('ol.source.Tile', function() {
});
// check the loaded tile is there
var tile = source.getTile(1, 0, 0);
expect(tile).to.be.a(_ol_Tile_);
expect(tile).to.be.a(Tile);
// check tile cache is filled
expect(source.tileCache.getCount()).to.eql(1);
// refresh the source
@@ -312,17 +312,17 @@ describe('MockTile', function() {
// check a loaded tile
tile = source.getTile(0, 0, 0);
expect(tile).to.be.a(_ol_Tile_);
expect(tile).to.be.a(Tile);
expect(tile.state).to.be(2); // LOADED
// check a tile that is not loaded
tile = source.getTile(1, 0, -1);
expect(tile).to.be.a(_ol_Tile_);
expect(tile).to.be.a(Tile);
expect(tile.state).to.be(0); // IDLE
// check another loaded tile
tile = source.getTile(1, 0, 0);
expect(tile).to.be.a(_ol_Tile_);
expect(tile).to.be.a(Tile);
expect(tile.state).to.be(2); // LOADED
});
+5 -5
View File
@@ -1,6 +1,6 @@
import {getUid} from '../../../src/ol/index.js';
import ImageTile from '../../../src/ol/ImageTile.js';
import _ol_Tile_ from '../../../src/ol/Tile.js';
import Tile from '../../../src/ol/Tile.js';
import TileState from '../../../src/ol/TileState.js';
@@ -8,14 +8,14 @@ describe('ol.Tile', function() {
describe('constructor', function() {
it('sets a default transition', function() {
var coord = [0, 0, 0];
var tile = new _ol_Tile_(coord, TileState.IDLE);
var tile = new Tile(coord, TileState.IDLE);
expect(tile.transition_).to.equal(250);
});
it('allows the transition to be set', function() {
var coord = [0, 0, 0];
var transition = 500;
var tile = new _ol_Tile_(coord, TileState.IDLE, {transition: transition});
var tile = new Tile(coord, TileState.IDLE, {transition: transition});
expect(tile.transition_).to.equal(transition);
});
});
@@ -23,7 +23,7 @@ describe('ol.Tile', function() {
describe('#getAlpha()', function() {
it('returns the alpha value for a tile in transition', function() {
var coord = [0, 0, 0];
var tile = new _ol_Tile_(coord, TileState.IDLE);
var tile = new Tile(coord, TileState.IDLE);
var id = 'test';
var time = Date.now();
@@ -45,7 +45,7 @@ describe('ol.Tile', function() {
describe('#inTransition()', function() {
it('determines if the tile is in transition', function() {
var coord = [0, 0, 0];
var tile = new _ol_Tile_(coord, TileState.IDLE);
var tile = new Tile(coord, TileState.IDLE);
var id = 'test';
expect(tile.inTransition(id)).to.be(true);
+8 -8
View File
@@ -1,4 +1,4 @@
import _ol_Tile_ from '../../../src/ol/Tile.js';
import Tile from '../../../src/ol/Tile.js';
import TileCache from '../../../src/ol/TileCache.js';
import _ol_tilecoord_ from '../../../src/ol/tilecoord.js';
@@ -8,13 +8,13 @@ describe('ol.TileCache', function() {
describe('#pruneExceptNewestZ()', function() {
it('gets rid of all entries that are not at the newest z', function() {
var tiles = [
new _ol_Tile_([0, 0, 0]),
new _ol_Tile_([1, 0, 0]),
new _ol_Tile_([1, 1, 0]),
new _ol_Tile_([2, 0, 0]),
new _ol_Tile_([2, 1, 0]),
new _ol_Tile_([2, 2, 0]),
new _ol_Tile_([2, 3, 0]) // newest tile at z: 2
new Tile([0, 0, 0]),
new Tile([1, 0, 0]),
new Tile([1, 1, 0]),
new Tile([2, 0, 0]),
new Tile([2, 1, 0]),
new Tile([2, 2, 0]),
new Tile([2, 3, 0]) // newest tile at z: 2
];
var cache = new TileCache();
+2 -2
View File
@@ -1,5 +1,5 @@
import ImageTile from '../../../src/ol/ImageTile.js';
import _ol_Tile_ from '../../../src/ol/Tile.js';
import Tile from '../../../src/ol/Tile.js';
import TileQueue from '../../../src/ol/TileQueue.js';
import TileState from '../../../src/ol/TileState.js';
import ImageSource from '../../../src/ol/source/Image.js';
@@ -11,7 +11,7 @@ describe('ol.TileQueue', function() {
function addRandomPriorityTiles(tq, num) {
var i, tile, priority;
for (i = 0; i < num; i++) {
tile = new _ol_Tile_();
tile = new Tile();
priority = Math.floor(Math.random() * 100);
tq.elements_.push([tile, '', [0, 0]]);
tq.priorities_.push(priority);