Named exports from tilecoord

This commit is contained in:
Marc Jansen
2018-02-08 16:58:34 +01:00
parent a01b38bc36
commit 685b46f1e3
20 changed files with 97 additions and 116 deletions

View File

@@ -1,5 +1,5 @@
import BingMaps from '../../../../src/ol/source/BingMaps.js';
import _ol_tilecoord_ from '../../../../src/ol/tilecoord.js';
import {quadKey} from '../../../../src/ol/tilecoord.js';
import Observable from '../../../../src/ol/Observable.js';
@@ -48,28 +48,28 @@ describe('ol.source.BingMaps', function() {
tileUrl = source.tileUrlFunction(
tileGrid.getTileCoordForCoordAndZ(coordinate, 1), 1, projection);
expect(tileUrl.match(regex)[1]).to.equal(_ol_tilecoord_.quadKey([1, 1, 0]));
expect(tileUrl.match(regex)[1]).to.equal(quadKey([1, 1, 0]));
tileUrl = source.tileUrlFunction(
tileGrid.getTileCoordForCoordAndZ(coordinate, 2), 1, projection);
expect(tileUrl.match(regex)[1]).to.equal(_ol_tilecoord_.quadKey([2, 2, 1]));
expect(tileUrl.match(regex)[1]).to.equal(quadKey([2, 2, 1]));
tileUrl = source.tileUrlFunction(
tileGrid.getTileCoordForCoordAndZ(coordinate, 3), 1, projection);
expect(tileUrl.match(regex)[1]).to.equal(_ol_tilecoord_.quadKey([3, 4, 2]));
expect(tileUrl.match(regex)[1]).to.equal(quadKey([3, 4, 2]));
tileUrl = source.tileUrlFunction(
tileGrid.getTileCoordForCoordAndZ(coordinate, 4), 1, projection);
expect(tileUrl.match(regex)[1]).to.equal(_ol_tilecoord_.quadKey([4, 8, 5]));
expect(tileUrl.match(regex)[1]).to.equal(quadKey([4, 8, 5]));
tileUrl = source.tileUrlFunction(
tileGrid.getTileCoordForCoordAndZ(coordinate, 5), 1, projection);
expect(tileUrl.match(regex)[1]).to.equal(_ol_tilecoord_.quadKey(
expect(tileUrl.match(regex)[1]).to.equal(quadKey(
[5, 16, 11]));
tileUrl = source.tileUrlFunction(
tileGrid.getTileCoordForCoordAndZ(coordinate, 6), 1, projection);
expect(tileUrl.match(regex)[1]).to.equal(_ol_tilecoord_.quadKey(
expect(tileUrl.match(regex)[1]).to.equal(quadKey(
[6, 33, 22]));
});

View File

@@ -5,7 +5,7 @@ import {get as getProjection} from '../../../../src/ol/proj.js';
import Projection from '../../../../src/ol/proj/Projection.js';
import Source from '../../../../src/ol/source/Source.js';
import TileSource from '../../../../src/ol/source/Tile.js';
import _ol_tilecoord_ from '../../../../src/ol/tilecoord.js';
import {getKeyZXY} from '../../../../src/ol/tilecoord.js';
import TileGrid from '../../../../src/ol/tilegrid/TileGrid.js';
@@ -42,7 +42,7 @@ inherits(MockTile, TileSource);
* @inheritDoc
*/
MockTile.prototype.getTile = function(z, x, y) {
const key = _ol_tilecoord_.getKeyZXY(z, x, y);
const key = getKeyZXY(z, x, y);
if (this.tileCache.containsKey(key)) {
return /** @type {!ol.Tile} */ (this.tileCache.get(key));
} else {

View File

@@ -8,7 +8,7 @@ import {WORLD_EXTENT} from '../../../../src/ol/proj/epsg3857.js';
import Projection from '../../../../src/ol/proj/Projection.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 {getKeyZXY} from '../../../../src/ol/tilecoord.js';
import {createXYZ, createForProjection} from '../../../../src/ol/tilegrid.js';
@@ -51,7 +51,7 @@ describe('ol.source.TileImage', function() {
expect(source.getKey()).to.be('');
source.getTileInternal(0, 0, -1, 1, getProjection('EPSG:3857'));
expect(source.tileCache.getCount()).to.be(1);
tile = source.tileCache.get(_ol_tilecoord_.getKeyZXY(0, 0, -1));
tile = source.tileCache.get(getKeyZXY(0, 0, -1));
});
it('gets the tile from the cache', function() {