Base render tile grid on the source grid
Use source zDirection for both grids
This commit is contained in:
@@ -228,17 +228,13 @@ describe('ol.source.VectorTile', function () {
|
||||
});
|
||||
|
||||
describe('different source and render tile grids', function () {
|
||||
let source, map, loaded, requested, target;
|
||||
let source, map, loaded, target;
|
||||
|
||||
beforeEach(function () {
|
||||
loaded = [];
|
||||
requested = 0;
|
||||
|
||||
function tileUrlFunction(tileCoord) {
|
||||
++requested;
|
||||
if (tileCoord.toString() == '5,13,-29') {
|
||||
return tileCoord.join('/');
|
||||
}
|
||||
return tileCoord.join('/');
|
||||
}
|
||||
|
||||
function tileLoadFunction(tile, src) {
|
||||
@@ -286,11 +282,10 @@ describe('ol.source.VectorTile', function () {
|
||||
document.body.removeChild(target);
|
||||
});
|
||||
|
||||
it('loads available tiles', function (done) {
|
||||
it('loads only required tiles', function (done) {
|
||||
map.renderSync();
|
||||
setTimeout(function () {
|
||||
expect(requested).to.be.greaterThan(1);
|
||||
expect(loaded).to.eql(['5/13/-29']);
|
||||
expect(loaded).to.eql(['5/13/-28']);
|
||||
done();
|
||||
}, 0);
|
||||
});
|
||||
|
||||
@@ -63,6 +63,7 @@ describe('ol.VectorRenderTile', function () {
|
||||
});
|
||||
|
||||
it("only loads tiles within the source tileGrid's extent", function (done) {
|
||||
let tile;
|
||||
const url = 'spec/ol/data/point.json';
|
||||
const source = new VectorTileSource({
|
||||
projection: 'EPSG:4326',
|
||||
@@ -77,8 +78,12 @@ describe('ol.VectorRenderTile', function () {
|
||||
},
|
||||
url: url,
|
||||
});
|
||||
const tile = source.getTile(0, 0, 0, 1, source.getProjection());
|
||||
|
||||
tile = source.getTile(0, 0, 0, 1, source.getProjection());
|
||||
expect(tile.getState()).to.be(TileState.EMPTY);
|
||||
|
||||
tile = source.getTile(0, 16, 9, 1, source.getProjection());
|
||||
expect(tile.getState()).to.be(TileState.IDLE);
|
||||
tile.load();
|
||||
const key = listen(tile, EventType.CHANGE, function () {
|
||||
if (tile.getState() === TileState.LOADED) {
|
||||
|
||||
Reference in New Issue
Block a user