Rename _ol_source_Tile_ to TileSource

This commit is contained in:
Tim Schaub
2018-01-08 10:11:20 -07:00
parent d75623084e
commit d2c0ea103e
10 changed files with 57 additions and 57 deletions

View File

@@ -3,7 +3,7 @@ import _ol_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';
import _ol_source_Tile_ from '../../../../src/ol/source/Tile.js';
import TileSource from '../../../../src/ol/source/Tile.js';
import _ol_tilegrid_ from '../../../../src/ol/tilegrid.js';
describe('ol.control.Attribution', function() {
@@ -21,21 +21,21 @@ describe('ol.control.Attribution', function() {
})],
layers: [
new TileLayer({
source: new _ol_source_Tile_({
source: new TileSource({
projection: 'EPSG:3857',
tileGrid: _ol_tilegrid_.createXYZ(),
attributions: 'foo'
})
}),
new TileLayer({
source: new _ol_source_Tile_({
source: new TileSource({
projection: 'EPSG:3857',
tileGrid: _ol_tilegrid_.createXYZ(),
attributions: 'bar'
})
}),
new TileLayer({
source: new _ol_source_Tile_({
source: new TileSource({
projection: 'EPSG:3857',
tileGrid: _ol_tilegrid_.createXYZ(),
attributions: 'foo'

View File

@@ -6,7 +6,7 @@ import _ol_proj_Projection_ from '../../../../src/ol/proj/Projection.js';
import _ol_source_ImageStatic_ from '../../../../src/ol/source/ImageStatic.js';
import RasterSource from '../../../../src/ol/source/Raster.js';
import Source from '../../../../src/ol/source/Source.js';
import _ol_source_Tile_ from '../../../../src/ol/source/Tile.js';
import TileSource from '../../../../src/ol/source/Tile.js';
import _ol_source_XYZ_ from '../../../../src/ol/source/XYZ.js';
var red = 'data:image/gif;base64,R0lGODlhAQABAPAAAP8AAP///yH5BAAAAAAALAAAAAA' +
@@ -92,7 +92,7 @@ where('Uint8ClampedArray').describe('ol.source.Raster', function() {
it('returns a tile source', function() {
var source = new RasterSource({
threads: 0,
sources: [new _ol_source_Tile_({})]
sources: [new TileSource({})]
});
expect(source).to.be.a(Source);
expect(source).to.be.a(RasterSource);

View File

@@ -4,7 +4,7 @@ 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';
import Source from '../../../../src/ol/source/Source.js';
import _ol_source_Tile_ from '../../../../src/ol/source/Tile.js';
import TileSource from '../../../../src/ol/source/Tile.js';
import _ol_tilecoord_ from '../../../../src/ol/tilecoord.js';
import TileGrid from '../../../../src/ol/tilegrid/TileGrid.js';
@@ -25,7 +25,7 @@ var MockTile = function(tileStates) {
tileSize: 256
});
_ol_source_Tile_.call(this, {
TileSource.call(this, {
projection: getProjection('EPSG:4326'),
tileGrid: tileGrid
});
@@ -35,7 +35,7 @@ var MockTile = function(tileStates) {
}
};
inherits(MockTile, _ol_source_Tile_);
inherits(MockTile, TileSource);
/**
@@ -56,15 +56,15 @@ describe('ol.source.Tile', function() {
describe('constructor', function() {
it('returns a tile source', function() {
var source = new _ol_source_Tile_({
var source = new TileSource({
projection: getProjection('EPSG:4326')
});
expect(source).to.be.a(Source);
expect(source).to.be.a(_ol_source_Tile_);
expect(source).to.be.a(TileSource);
});
it('sets a custom cache size', function() {
var projection = getProjection('EPSG:4326');
var source = new _ol_source_Tile_({
var source = new TileSource({
projection: projection,
cacheSize: 42
});
@@ -74,7 +74,7 @@ describe('ol.source.Tile', function() {
describe('#setKey()', function() {
it('sets the source key', function() {
var source = new _ol_source_Tile_({});
var source = new TileSource({});
expect(source.getKey()).to.equal('');
var key = 'foo';
@@ -85,7 +85,7 @@ describe('ol.source.Tile', function() {
describe('#setKey()', function() {
it('dispatches a change event', function(done) {
var source = new _ol_source_Tile_({});
var source = new TileSource({});
var key = 'foo';
source.once('change', function() {
@@ -95,7 +95,7 @@ describe('ol.source.Tile', function() {
});
it('does not dispatch change if key does not change', function(done) {
var source = new _ol_source_Tile_({});
var source = new TileSource({});
var key = 'foo';
source.once('change', function() {
@@ -225,7 +225,7 @@ describe('ol.source.Tile', function() {
describe('#getTileCoordForTileUrlFunction()', function() {
it('returns the expected tile coordinate - {wrapX: true}', function() {
var tileSource = new _ol_source_Tile_({
var tileSource = new TileSource({
projection: 'EPSG:3857',
wrapX: true
});
@@ -241,7 +241,7 @@ describe('ol.source.Tile', function() {
});
it('returns the expected tile coordinate - {wrapX: false}', function() {
var tileSource = new _ol_source_Tile_({
var tileSource = new TileSource({
projection: 'EPSG:3857',
wrapX: false
});
@@ -257,7 +257,7 @@ describe('ol.source.Tile', function() {
});
it('works with wrapX and custom projection without extent', function() {
var tileSource = new _ol_source_Tile_({
var tileSource = new TileSource({
projection: new _ol_proj_Projection_({
code: 'foo',
global: true,
@@ -297,7 +297,7 @@ describe('MockTile', function() {
describe('constructor', function() {
it('creates a tile source', function() {
var source = new MockTile({});
expect(source).to.be.a(_ol_source_Tile_);
expect(source).to.be.a(TileSource);
expect(source).to.be.a(MockTile);
});
});

View File

@@ -1,5 +1,5 @@
import {get as getProjection, transformExtent, fromLonLat} from '../../../../src/ol/proj.js';
import _ol_source_Tile_ from '../../../../src/ol/source/Tile.js';
import TileSource from '../../../../src/ol/source/Tile.js';
import _ol_source_TileUTFGrid_ from '../../../../src/ol/source/TileUTFGrid.js';
import TileGrid from '../../../../src/ol/tilegrid/TileGrid.js';
@@ -39,7 +39,7 @@ describe('ol.source.TileUTFGrid', function() {
var source = new _ol_source_TileUTFGrid_({url: url});
expect(source).to.be.an(_ol_source_TileUTFGrid_);
expect(source).to.be.an(_ol_source_Tile_);
expect(source).to.be.an(TileSource);
expect(function() {
// no options: will throw

View File

@@ -1,4 +1,4 @@
import _ol_source_Tile_ from '../../../../src/ol/source/Tile.js';
import TileSource from '../../../../src/ol/source/Tile.js';
import _ol_source_TileImage_ from '../../../../src/ol/source/TileImage.js';
import _ol_source_UrlTile_ from '../../../../src/ol/source/UrlTile.js';
import _ol_source_XYZ_ from '../../../../src/ol/source/XYZ.js';
@@ -14,7 +14,7 @@ describe('ol.source.XYZ', function() {
expect(source).to.be.an(_ol_source_XYZ_);
expect(source).to.be.an(_ol_source_TileImage_);
expect(source).to.be.an(_ol_source_UrlTile_);
expect(source).to.be.an(_ol_source_Tile_);
expect(source).to.be.an(TileSource);
});
it('can be constructed with a custom tile grid', function() {