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
+2 -2
View File
@@ -18,7 +18,7 @@ import CanvasTileLayerRenderer from '../renderer/canvas/TileLayer.js';
import ImageSource from '../source/Image.js'; import ImageSource from '../source/Image.js';
import RasterOperationType from '../source/RasterOperationType.js'; import RasterOperationType from '../source/RasterOperationType.js';
import SourceState from '../source/State.js'; import SourceState from '../source/State.js';
import _ol_source_Tile_ from '../source/Tile.js'; import TileSource from '../source/Tile.js';
import _ol_transform_ from '../transform.js'; import _ol_transform_ from '../transform.js';
@@ -398,7 +398,7 @@ function createRenderers(sources) {
*/ */
function createRenderer(source) { function createRenderer(source) {
var renderer = null; var renderer = null;
if (source instanceof _ol_source_Tile_) { if (source instanceof TileSource) {
renderer = createTileRenderer(source); renderer = createTileRenderer(source);
} else if (source instanceof ImageSource) { } else if (source instanceof ImageSource) {
renderer = createImageRenderer(source); renderer = createImageRenderer(source);
+22 -22
View File
@@ -23,7 +23,7 @@ import _ol_tilegrid_ from '../tilegrid.js';
* @param {ol.SourceTileOptions} options Tile source options. * @param {ol.SourceTileOptions} options Tile source options.
* @api * @api
*/ */
var _ol_source_Tile_ = function(options) { var TileSource = function(options) {
Source.call(this, { Source.call(this, {
attributions: options.attributions, attributions: options.attributions,
@@ -78,13 +78,13 @@ var _ol_source_Tile_ = function(options) {
}; };
inherits(_ol_source_Tile_, Source); inherits(TileSource, Source);
/** /**
* @return {boolean} Can expire cache. * @return {boolean} Can expire cache.
*/ */
_ol_source_Tile_.prototype.canExpireCache = function() { TileSource.prototype.canExpireCache = function() {
return this.tileCache.canExpireCache(); return this.tileCache.canExpireCache();
}; };
@@ -93,7 +93,7 @@ _ol_source_Tile_.prototype.canExpireCache = function() {
* @param {ol.proj.Projection} projection Projection. * @param {ol.proj.Projection} projection Projection.
* @param {Object.<string, ol.TileRange>} usedTiles Used tiles. * @param {Object.<string, ol.TileRange>} usedTiles Used tiles.
*/ */
_ol_source_Tile_.prototype.expireCache = function(projection, usedTiles) { TileSource.prototype.expireCache = function(projection, usedTiles) {
var tileCache = this.getTileCacheForProjection(projection); var tileCache = this.getTileCacheForProjection(projection);
if (tileCache) { if (tileCache) {
tileCache.expireCache(usedTiles); tileCache.expireCache(usedTiles);
@@ -110,7 +110,7 @@ _ol_source_Tile_.prototype.expireCache = function(projection, usedTiles) {
* considered loaded. * considered loaded.
* @return {boolean} The tile range is fully covered with loaded tiles. * @return {boolean} The tile range is fully covered with loaded tiles.
*/ */
_ol_source_Tile_.prototype.forEachLoadedTile = function(projection, z, tileRange, callback) { TileSource.prototype.forEachLoadedTile = function(projection, z, tileRange, callback) {
var tileCache = this.getTileCacheForProjection(projection); var tileCache = this.getTileCacheForProjection(projection);
if (!tileCache) { if (!tileCache) {
return false; return false;
@@ -142,7 +142,7 @@ _ol_source_Tile_.prototype.forEachLoadedTile = function(projection, z, tileRange
* @param {ol.proj.Projection} projection Projection. * @param {ol.proj.Projection} projection Projection.
* @return {number} Gutter. * @return {number} Gutter.
*/ */
_ol_source_Tile_.prototype.getGutter = function(projection) { TileSource.prototype.getGutter = function(projection) {
return 0; return 0;
}; };
@@ -152,7 +152,7 @@ _ol_source_Tile_.prototype.getGutter = function(projection) {
* @return {string} The key for all tiles. * @return {string} The key for all tiles.
* @protected * @protected
*/ */
_ol_source_Tile_.prototype.getKey = function() { TileSource.prototype.getKey = function() {
return this.key_; return this.key_;
}; };
@@ -162,7 +162,7 @@ _ol_source_Tile_.prototype.getKey = function() {
* @param {string} key The key for tiles. * @param {string} key The key for tiles.
* @protected * @protected
*/ */
_ol_source_Tile_.prototype.setKey = function(key) { TileSource.prototype.setKey = function(key) {
if (this.key_ !== key) { if (this.key_ !== key) {
this.key_ = key; this.key_ = key;
this.changed(); this.changed();
@@ -174,7 +174,7 @@ _ol_source_Tile_.prototype.setKey = function(key) {
* @param {ol.proj.Projection} projection Projection. * @param {ol.proj.Projection} projection Projection.
* @return {boolean} Opaque. * @return {boolean} Opaque.
*/ */
_ol_source_Tile_.prototype.getOpaque = function(projection) { TileSource.prototype.getOpaque = function(projection) {
return this.opaque_; return this.opaque_;
}; };
@@ -182,7 +182,7 @@ _ol_source_Tile_.prototype.getOpaque = function(projection) {
/** /**
* @inheritDoc * @inheritDoc
*/ */
_ol_source_Tile_.prototype.getResolutions = function() { TileSource.prototype.getResolutions = function() {
return this.tileGrid.getResolutions(); return this.tileGrid.getResolutions();
}; };
@@ -196,7 +196,7 @@ _ol_source_Tile_.prototype.getResolutions = function() {
* @param {ol.proj.Projection} projection Projection. * @param {ol.proj.Projection} projection Projection.
* @return {!ol.Tile} Tile. * @return {!ol.Tile} Tile.
*/ */
_ol_source_Tile_.prototype.getTile = function(z, x, y, pixelRatio, projection) {}; TileSource.prototype.getTile = function(z, x, y, pixelRatio, projection) {};
/** /**
@@ -204,7 +204,7 @@ _ol_source_Tile_.prototype.getTile = function(z, x, y, pixelRatio, projection) {
* @return {ol.tilegrid.TileGrid} Tile grid. * @return {ol.tilegrid.TileGrid} Tile grid.
* @api * @api
*/ */
_ol_source_Tile_.prototype.getTileGrid = function() { TileSource.prototype.getTileGrid = function() {
return this.tileGrid; return this.tileGrid;
}; };
@@ -213,7 +213,7 @@ _ol_source_Tile_.prototype.getTileGrid = function() {
* @param {ol.proj.Projection} projection Projection. * @param {ol.proj.Projection} projection Projection.
* @return {!ol.tilegrid.TileGrid} Tile grid. * @return {!ol.tilegrid.TileGrid} Tile grid.
*/ */
_ol_source_Tile_.prototype.getTileGridForProjection = function(projection) { TileSource.prototype.getTileGridForProjection = function(projection) {
if (!this.tileGrid) { if (!this.tileGrid) {
return _ol_tilegrid_.getForProjection(projection); return _ol_tilegrid_.getForProjection(projection);
} else { } else {
@@ -227,7 +227,7 @@ _ol_source_Tile_.prototype.getTileGridForProjection = function(projection) {
* @return {ol.TileCache} Tile cache. * @return {ol.TileCache} Tile cache.
* @protected * @protected
*/ */
_ol_source_Tile_.prototype.getTileCacheForProjection = function(projection) { TileSource.prototype.getTileCacheForProjection = function(projection) {
var thisProj = this.getProjection(); var thisProj = this.getProjection();
if (thisProj && !equivalent(thisProj, projection)) { if (thisProj && !equivalent(thisProj, projection)) {
return null; return null;
@@ -244,7 +244,7 @@ _ol_source_Tile_.prototype.getTileCacheForProjection = function(projection) {
* @param {number} pixelRatio Pixel ratio. * @param {number} pixelRatio Pixel ratio.
* @return {number} Tile pixel ratio. * @return {number} Tile pixel ratio.
*/ */
_ol_source_Tile_.prototype.getTilePixelRatio = function(pixelRatio) { TileSource.prototype.getTilePixelRatio = function(pixelRatio) {
return this.tilePixelRatio_; return this.tilePixelRatio_;
}; };
@@ -255,7 +255,7 @@ _ol_source_Tile_.prototype.getTilePixelRatio = function(pixelRatio) {
* @param {ol.proj.Projection} projection Projection. * @param {ol.proj.Projection} projection Projection.
* @return {ol.Size} Tile size. * @return {ol.Size} Tile size.
*/ */
_ol_source_Tile_.prototype.getTilePixelSize = function(z, pixelRatio, projection) { TileSource.prototype.getTilePixelSize = function(z, pixelRatio, projection) {
var tileGrid = this.getTileGridForProjection(projection); var tileGrid = this.getTileGridForProjection(projection);
var tilePixelRatio = this.getTilePixelRatio(pixelRatio); var tilePixelRatio = this.getTilePixelRatio(pixelRatio);
var tileSize = _ol_size_.toSize(tileGrid.getTileSize(z), this.tmpSize); var tileSize = _ol_size_.toSize(tileGrid.getTileSize(z), this.tmpSize);
@@ -276,7 +276,7 @@ _ol_source_Tile_.prototype.getTilePixelSize = function(z, pixelRatio, projection
* @return {ol.TileCoord} Tile coordinate to be passed to the tileUrlFunction or * @return {ol.TileCoord} Tile coordinate to be passed to the tileUrlFunction or
* null if no tile URL should be created for the passed `tileCoord`. * null if no tile URL should be created for the passed `tileCoord`.
*/ */
_ol_source_Tile_.prototype.getTileCoordForTileUrlFunction = function(tileCoord, opt_projection) { TileSource.prototype.getTileCoordForTileUrlFunction = function(tileCoord, opt_projection) {
var projection = opt_projection !== undefined ? var projection = opt_projection !== undefined ?
opt_projection : this.getProjection(); opt_projection : this.getProjection();
var tileGrid = this.getTileGridForProjection(projection); var tileGrid = this.getTileGridForProjection(projection);
@@ -290,7 +290,7 @@ _ol_source_Tile_.prototype.getTileCoordForTileUrlFunction = function(tileCoord,
/** /**
* @inheritDoc * @inheritDoc
*/ */
_ol_source_Tile_.prototype.refresh = function() { TileSource.prototype.refresh = function() {
this.tileCache.clear(); this.tileCache.clear();
this.changed(); this.changed();
}; };
@@ -303,7 +303,7 @@ _ol_source_Tile_.prototype.refresh = function() {
* @param {number} y Tile coordinate y. * @param {number} y Tile coordinate y.
* @param {ol.proj.Projection} projection Projection. * @param {ol.proj.Projection} projection Projection.
*/ */
_ol_source_Tile_.prototype.useTile = nullFunction; TileSource.prototype.useTile = nullFunction;
/** /**
@@ -317,7 +317,7 @@ _ol_source_Tile_.prototype.useTile = nullFunction;
* @param {string} type Type. * @param {string} type Type.
* @param {ol.Tile} tile The tile. * @param {ol.Tile} tile The tile.
*/ */
_ol_source_Tile_.Event = function(type, tile) { TileSource.Event = function(type, tile) {
Event.call(this, type); Event.call(this, type);
@@ -329,5 +329,5 @@ _ol_source_Tile_.Event = function(type, tile) {
this.tile = tile; this.tile = tile;
}; };
inherits(_ol_source_Tile_.Event, Event); inherits(TileSource.Event, Event);
export default _ol_source_Tile_; export default TileSource;
+3 -3
View File
@@ -6,7 +6,7 @@ import _ol_Tile_ from '../Tile.js';
import TileState from '../TileState.js'; import TileState from '../TileState.js';
import {createCanvasContext2D} from '../dom.js'; import {createCanvasContext2D} from '../dom.js';
import _ol_size_ from '../size.js'; import _ol_size_ from '../size.js';
import _ol_source_Tile_ from '../source/Tile.js'; import TileSource from '../source/Tile.js';
import _ol_tilecoord_ from '../tilecoord.js'; import _ol_tilecoord_ from '../tilecoord.js';
/** /**
@@ -24,7 +24,7 @@ import _ol_tilecoord_ from '../tilecoord.js';
*/ */
var _ol_source_TileDebug_ = function(options) { var _ol_source_TileDebug_ = function(options) {
_ol_source_Tile_.call(this, { TileSource.call(this, {
opaque: false, opaque: false,
projection: options.projection, projection: options.projection,
tileGrid: options.tileGrid, tileGrid: options.tileGrid,
@@ -33,7 +33,7 @@ var _ol_source_TileDebug_ = function(options) {
}; };
inherits(_ol_source_TileDebug_, _ol_source_Tile_); inherits(_ol_source_TileDebug_, TileSource);
/** /**
+3 -3
View File
@@ -12,7 +12,7 @@ import {applyTransform, intersects} from '../extent.js';
import _ol_net_ from '../net.js'; import _ol_net_ from '../net.js';
import {get as getProjection, getTransformFromProjections} from '../proj.js'; import {get as getProjection, getTransformFromProjections} from '../proj.js';
import SourceState from '../source/State.js'; import SourceState from '../source/State.js';
import _ol_source_Tile_ from '../source/Tile.js'; import TileSource from '../source/Tile.js';
import _ol_tilecoord_ from '../tilecoord.js'; import _ol_tilecoord_ from '../tilecoord.js';
import _ol_tilegrid_ from '../tilegrid.js'; import _ol_tilegrid_ from '../tilegrid.js';
@@ -26,7 +26,7 @@ import _ol_tilegrid_ from '../tilegrid.js';
* @api * @api
*/ */
var _ol_source_TileUTFGrid_ = function(options) { var _ol_source_TileUTFGrid_ = function(options) {
_ol_source_Tile_.call(this, { TileSource.call(this, {
projection: getProjection('EPSG:3857'), projection: getProjection('EPSG:3857'),
state: SourceState.LOADING state: SourceState.LOADING
}); });
@@ -74,7 +74,7 @@ var _ol_source_TileUTFGrid_ = function(options) {
} }
}; };
inherits(_ol_source_TileUTFGrid_, _ol_source_Tile_); inherits(_ol_source_TileUTFGrid_, TileSource);
/** /**
+4 -4
View File
@@ -4,7 +4,7 @@
import {getUid, inherits} from '../index.js'; import {getUid, inherits} from '../index.js';
import TileState from '../TileState.js'; import TileState from '../TileState.js';
import {expandUrl, createFromTemplates, nullTileUrlFunction} from '../tileurlfunction.js'; import {expandUrl, createFromTemplates, nullTileUrlFunction} from '../tileurlfunction.js';
import _ol_source_Tile_ from '../source/Tile.js'; import TileSource from '../source/Tile.js';
import TileEventType from '../source/TileEventType.js'; import TileEventType from '../source/TileEventType.js';
import _ol_tilecoord_ from '../tilecoord.js'; import _ol_tilecoord_ from '../tilecoord.js';
@@ -20,7 +20,7 @@ import _ol_tilecoord_ from '../tilecoord.js';
*/ */
var _ol_source_UrlTile_ = function(options) { var _ol_source_UrlTile_ = function(options) {
_ol_source_Tile_.call(this, { TileSource.call(this, {
attributions: options.attributions, attributions: options.attributions,
cacheSize: options.cacheSize, cacheSize: options.cacheSize,
extent: options.extent, extent: options.extent,
@@ -69,7 +69,7 @@ var _ol_source_UrlTile_ = function(options) {
}; };
inherits(_ol_source_UrlTile_, _ol_source_Tile_); inherits(_ol_source_UrlTile_, TileSource);
/** /**
@@ -130,7 +130,7 @@ _ol_source_UrlTile_.prototype.handleTileChange = function(event) {
TileEventType.TILELOADEND : undefined; TileEventType.TILELOADEND : undefined;
} }
if (type != undefined) { if (type != undefined) {
this.dispatchEvent(new _ol_source_Tile_.Event(type, tile)); this.dispatchEvent(new TileSource.Event(type, tile));
} }
}; };
+4 -4
View File
@@ -3,7 +3,7 @@ import _ol_Tile_ from '../../../../src/ol/Tile.js';
import View from '../../../../src/ol/View.js'; import View from '../../../../src/ol/View.js';
import Attribution from '../../../../src/ol/control/Attribution.js'; import Attribution from '../../../../src/ol/control/Attribution.js';
import TileLayer from '../../../../src/ol/layer/Tile.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'; import _ol_tilegrid_ from '../../../../src/ol/tilegrid.js';
describe('ol.control.Attribution', function() { describe('ol.control.Attribution', function() {
@@ -21,21 +21,21 @@ describe('ol.control.Attribution', function() {
})], })],
layers: [ layers: [
new TileLayer({ new TileLayer({
source: new _ol_source_Tile_({ source: new TileSource({
projection: 'EPSG:3857', projection: 'EPSG:3857',
tileGrid: _ol_tilegrid_.createXYZ(), tileGrid: _ol_tilegrid_.createXYZ(),
attributions: 'foo' attributions: 'foo'
}) })
}), }),
new TileLayer({ new TileLayer({
source: new _ol_source_Tile_({ source: new TileSource({
projection: 'EPSG:3857', projection: 'EPSG:3857',
tileGrid: _ol_tilegrid_.createXYZ(), tileGrid: _ol_tilegrid_.createXYZ(),
attributions: 'bar' attributions: 'bar'
}) })
}), }),
new TileLayer({ new TileLayer({
source: new _ol_source_Tile_({ source: new TileSource({
projection: 'EPSG:3857', projection: 'EPSG:3857',
tileGrid: _ol_tilegrid_.createXYZ(), tileGrid: _ol_tilegrid_.createXYZ(),
attributions: 'foo' attributions: 'foo'
+2 -2
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 _ol_source_ImageStatic_ from '../../../../src/ol/source/ImageStatic.js';
import RasterSource from '../../../../src/ol/source/Raster.js'; import RasterSource from '../../../../src/ol/source/Raster.js';
import Source from '../../../../src/ol/source/Source.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'; import _ol_source_XYZ_ from '../../../../src/ol/source/XYZ.js';
var red = 'data:image/gif;base64,R0lGODlhAQABAPAAAP8AAP///yH5BAAAAAAALAAAAAA' + 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() { it('returns a tile source', function() {
var source = new RasterSource({ var source = new RasterSource({
threads: 0, threads: 0,
sources: [new _ol_source_Tile_({})] sources: [new TileSource({})]
}); });
expect(source).to.be.a(Source); expect(source).to.be.a(Source);
expect(source).to.be.a(RasterSource); expect(source).to.be.a(RasterSource);
+13 -13
View File
@@ -4,7 +4,7 @@ import TileRange from '../../../../src/ol/TileRange.js';
import {get as getProjection} from '../../../../src/ol/proj.js'; import {get as getProjection} from '../../../../src/ol/proj.js';
import _ol_proj_Projection_ from '../../../../src/ol/proj/Projection.js'; import _ol_proj_Projection_ from '../../../../src/ol/proj/Projection.js';
import Source from '../../../../src/ol/source/Source.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 _ol_tilecoord_ from '../../../../src/ol/tilecoord.js';
import TileGrid from '../../../../src/ol/tilegrid/TileGrid.js'; import TileGrid from '../../../../src/ol/tilegrid/TileGrid.js';
@@ -25,7 +25,7 @@ var MockTile = function(tileStates) {
tileSize: 256 tileSize: 256
}); });
_ol_source_Tile_.call(this, { TileSource.call(this, {
projection: getProjection('EPSG:4326'), projection: getProjection('EPSG:4326'),
tileGrid: tileGrid 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() { describe('constructor', function() {
it('returns a tile source', function() { it('returns a tile source', function() {
var source = new _ol_source_Tile_({ var source = new TileSource({
projection: getProjection('EPSG:4326') projection: getProjection('EPSG:4326')
}); });
expect(source).to.be.a(Source); 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() { it('sets a custom cache size', function() {
var projection = getProjection('EPSG:4326'); var projection = getProjection('EPSG:4326');
var source = new _ol_source_Tile_({ var source = new TileSource({
projection: projection, projection: projection,
cacheSize: 42 cacheSize: 42
}); });
@@ -74,7 +74,7 @@ describe('ol.source.Tile', function() {
describe('#setKey()', function() { describe('#setKey()', function() {
it('sets the source key', function() { it('sets the source key', function() {
var source = new _ol_source_Tile_({}); var source = new TileSource({});
expect(source.getKey()).to.equal(''); expect(source.getKey()).to.equal('');
var key = 'foo'; var key = 'foo';
@@ -85,7 +85,7 @@ describe('ol.source.Tile', function() {
describe('#setKey()', function() { describe('#setKey()', function() {
it('dispatches a change event', function(done) { it('dispatches a change event', function(done) {
var source = new _ol_source_Tile_({}); var source = new TileSource({});
var key = 'foo'; var key = 'foo';
source.once('change', function() { 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) { 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'; var key = 'foo';
source.once('change', function() { source.once('change', function() {
@@ -225,7 +225,7 @@ describe('ol.source.Tile', function() {
describe('#getTileCoordForTileUrlFunction()', function() { describe('#getTileCoordForTileUrlFunction()', function() {
it('returns the expected tile coordinate - {wrapX: true}', function() { it('returns the expected tile coordinate - {wrapX: true}', function() {
var tileSource = new _ol_source_Tile_({ var tileSource = new TileSource({
projection: 'EPSG:3857', projection: 'EPSG:3857',
wrapX: true wrapX: true
}); });
@@ -241,7 +241,7 @@ describe('ol.source.Tile', function() {
}); });
it('returns the expected tile coordinate - {wrapX: false}', function() { it('returns the expected tile coordinate - {wrapX: false}', function() {
var tileSource = new _ol_source_Tile_({ var tileSource = new TileSource({
projection: 'EPSG:3857', projection: 'EPSG:3857',
wrapX: false wrapX: false
}); });
@@ -257,7 +257,7 @@ describe('ol.source.Tile', function() {
}); });
it('works with wrapX and custom projection without extent', 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_({ projection: new _ol_proj_Projection_({
code: 'foo', code: 'foo',
global: true, global: true,
@@ -297,7 +297,7 @@ describe('MockTile', function() {
describe('constructor', function() { describe('constructor', function() {
it('creates a tile source', function() { it('creates a tile source', function() {
var source = new MockTile({}); var source = new MockTile({});
expect(source).to.be.a(_ol_source_Tile_); expect(source).to.be.a(TileSource);
expect(source).to.be.a(MockTile); expect(source).to.be.a(MockTile);
}); });
}); });
+2 -2
View File
@@ -1,5 +1,5 @@
import {get as getProjection, transformExtent, fromLonLat} from '../../../../src/ol/proj.js'; 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 _ol_source_TileUTFGrid_ from '../../../../src/ol/source/TileUTFGrid.js';
import TileGrid from '../../../../src/ol/tilegrid/TileGrid.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}); var source = new _ol_source_TileUTFGrid_({url: url});
expect(source).to.be.an(_ol_source_TileUTFGrid_); expect(source).to.be.an(_ol_source_TileUTFGrid_);
expect(source).to.be.an(_ol_source_Tile_); expect(source).to.be.an(TileSource);
expect(function() { expect(function() {
// no options: will throw // no options: will throw
+2 -2
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_TileImage_ from '../../../../src/ol/source/TileImage.js';
import _ol_source_UrlTile_ from '../../../../src/ol/source/UrlTile.js'; import _ol_source_UrlTile_ from '../../../../src/ol/source/UrlTile.js';
import _ol_source_XYZ_ from '../../../../src/ol/source/XYZ.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_XYZ_);
expect(source).to.be.an(_ol_source_TileImage_); expect(source).to.be.an(_ol_source_TileImage_);
expect(source).to.be.an(_ol_source_UrlTile_); 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() { it('can be constructed with a custom tile grid', function() {