Named exports from ol/tilegrid
This commit is contained in:
@@ -9,7 +9,7 @@ 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 _ol_tilegrid_ from '../../../../src/ol/tilegrid.js';
|
||||
import {createXYZ, createForProjection} from '../../../../src/ol/tilegrid.js';
|
||||
|
||||
|
||||
describe('ol.source.TileImage', function() {
|
||||
@@ -19,7 +19,7 @@ describe('ol.source.TileImage', function() {
|
||||
cacheSize: opt_cacheSize,
|
||||
projection: proj,
|
||||
tileGrid: opt_tileGrid ||
|
||||
_ol_tilegrid_.createForProjection(proj, undefined, [2, 2]),
|
||||
createForProjection(proj, undefined, [2, 2]),
|
||||
tileUrlFunction: createFromTemplate('data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=')
|
||||
});
|
||||
}
|
||||
@@ -36,7 +36,7 @@ describe('ol.source.TileImage', function() {
|
||||
describe('#setTileGridForProjection', function() {
|
||||
it('uses the tilegrid for given projection', function() {
|
||||
const source = createSource();
|
||||
const tileGrid = _ol_tilegrid_.createForProjection('EPSG:4326', 3, [10, 20]);
|
||||
const tileGrid = createForProjection('EPSG:4326', 3, [10, 20]);
|
||||
source.setTileGridForProjection('EPSG:4326', tileGrid);
|
||||
const retrieved = source.getTileGridForProjection(getProjection('EPSG:4326'));
|
||||
expect(retrieved).to.be(tileGrid);
|
||||
@@ -141,7 +141,7 @@ describe('ol.source.TileImage', function() {
|
||||
});
|
||||
|
||||
it('can handle source projection without extent and units', function(done) {
|
||||
const source = createSource('4326_noextentnounits', _ol_tilegrid_.createXYZ({
|
||||
const source = createSource('4326_noextentnounits', createXYZ({
|
||||
extent: [-180, -90, 180, 90],
|
||||
tileSize: [2, 2]
|
||||
}));
|
||||
@@ -160,7 +160,7 @@ describe('ol.source.TileImage', function() {
|
||||
const proj = getProjection('4326_noextentnounits');
|
||||
const source = createSource();
|
||||
source.setTileGridForProjection(proj,
|
||||
_ol_tilegrid_.createXYZ({
|
||||
createXYZ({
|
||||
extent: WORLD_EXTENT,
|
||||
tileSize: [2, 2]
|
||||
}));
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import ImageTile from '../../../../src/ol/ImageTile.js';
|
||||
import {get as getProjection} from '../../../../src/ol/proj.js';
|
||||
import TileWMS from '../../../../src/ol/source/TileWMS.js';
|
||||
import _ol_tilegrid_ from '../../../../src/ol/tilegrid.js';
|
||||
import {createXYZ} from '../../../../src/ol/tilegrid.js';
|
||||
import TileGrid from '../../../../src/ol/tilegrid/TileGrid.js';
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ describe('ol.source.TileWMS', function() {
|
||||
it('can be constructed without url or urls params', function() {
|
||||
const source = new TileWMS({
|
||||
projection: 'EPSG:3857',
|
||||
tileGrid: _ol_tilegrid_.createXYZ({maxZoom: 6})
|
||||
tileGrid: createXYZ({maxZoom: 6})
|
||||
});
|
||||
expect(source).to.be.an(TileWMS);
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import {get as getProjection} from '../../../../src/ol/proj.js';
|
||||
import UrlTile from '../../../../src/ol/source/UrlTile.js';
|
||||
import _ol_tilegrid_ from '../../../../src/ol/tilegrid.js';
|
||||
import {createXYZ} from '../../../../src/ol/tilegrid.js';
|
||||
|
||||
|
||||
describe('ol.source.UrlTile', function() {
|
||||
@@ -71,7 +71,7 @@ describe('ol.source.UrlTile', function() {
|
||||
beforeEach(function() {
|
||||
tileSource = new UrlTile({
|
||||
projection: 'EPSG:3857',
|
||||
tileGrid: _ol_tilegrid_.createXYZ({maxZoom: 6}),
|
||||
tileGrid: createXYZ({maxZoom: 6}),
|
||||
url: '{z}/{x}/{y}',
|
||||
wrapX: true
|
||||
});
|
||||
@@ -167,7 +167,7 @@ describe('ol.source.UrlTile', function() {
|
||||
|
||||
beforeEach(function() {
|
||||
sourceOptions = {
|
||||
tileGrid: _ol_tilegrid_.createXYZ({
|
||||
tileGrid: createXYZ({
|
||||
extent: getProjection('EPSG:4326').getExtent()
|
||||
})
|
||||
};
|
||||
|
||||
@@ -6,7 +6,7 @@ import MVT from '../../../../src/ol/format/MVT.js';
|
||||
import VectorTileLayer from '../../../../src/ol/layer/VectorTile.js';
|
||||
import {get as getProjection} from '../../../../src/ol/proj.js';
|
||||
import VectorTileSource from '../../../../src/ol/source/VectorTile.js';
|
||||
import _ol_tilegrid_ from '../../../../src/ol/tilegrid.js';
|
||||
import {createXYZ} from '../../../../src/ol/tilegrid.js';
|
||||
import TileGrid from '../../../../src/ol/tilegrid/TileGrid.js';
|
||||
|
||||
describe('ol.source.VectorTile', function() {
|
||||
@@ -29,7 +29,7 @@ describe('ol.source.VectorTile', function() {
|
||||
});
|
||||
|
||||
it('creates a 512 XYZ tilegrid by default', function() {
|
||||
const tileGrid = _ol_tilegrid_.createXYZ({tileSize: 512});
|
||||
const tileGrid = createXYZ({tileSize: 512});
|
||||
expect(source.tileGrid.tileSize_).to.equal(tileGrid.tileSize_);
|
||||
expect(source.tileGrid.extent_).to.equal(tileGrid.extent_);
|
||||
});
|
||||
|
||||
@@ -2,7 +2,7 @@ import TileSource from '../../../../src/ol/source/Tile.js';
|
||||
import TileImage from '../../../../src/ol/source/TileImage.js';
|
||||
import UrlTile from '../../../../src/ol/source/UrlTile.js';
|
||||
import XYZ from '../../../../src/ol/source/XYZ.js';
|
||||
import _ol_tilegrid_ from '../../../../src/ol/tilegrid.js';
|
||||
import {createXYZ} from '../../../../src/ol/tilegrid.js';
|
||||
|
||||
|
||||
describe('ol.source.XYZ', function() {
|
||||
@@ -18,7 +18,7 @@ describe('ol.source.XYZ', function() {
|
||||
});
|
||||
|
||||
it('can be constructed with a custom tile grid', function() {
|
||||
const tileGrid = _ol_tilegrid_.createXYZ();
|
||||
const tileGrid = createXYZ();
|
||||
const tileSource = new XYZ({
|
||||
tileGrid: tileGrid
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user