Make zDirection configurable on tile source
This commit is contained in:
@@ -86,6 +86,17 @@ describe('ol.renderer.canvas.TileLayer', function() {
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('respects the source\'s zDirection setting', function(done) {
|
||||
layer.getSource().zDirection = 1;
|
||||
map.getView().setZoom(5.8); // would lead to z6 tile request with the default zDirection
|
||||
map.once('rendercomplete', function() {
|
||||
const tileCache = layer.getSource().tileCache;
|
||||
const keys = tileCache.getKeys();
|
||||
expect(keys.some(key => key.startsWith('6/'))).to.be(false);
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
@@ -101,7 +101,7 @@ describe('ol.renderer.canvas.VectorTileLayer', function() {
|
||||
it('creates a new instance', function() {
|
||||
const renderer = new CanvasVectorTileLayerRenderer(layer);
|
||||
expect(renderer).to.be.a(CanvasVectorTileLayerRenderer);
|
||||
expect(renderer.zDirection).to.be(1);
|
||||
expect(renderer.getLayer()).to.equal(layer);
|
||||
});
|
||||
|
||||
it('does not render replays for pure image rendering', function() {
|
||||
|
||||
@@ -26,6 +26,10 @@ describe('ol.source.VectorTile', function() {
|
||||
expect(source.format_).to.equal(format);
|
||||
});
|
||||
|
||||
it('sets the default zDirection on the instance', function() {
|
||||
expect(source.zDirection).to.be(1);
|
||||
});
|
||||
|
||||
it('uses ol.VectorTile as default tileClass', function() {
|
||||
expect(source.tileClass).to.equal(VectorTile);
|
||||
});
|
||||
|
||||
@@ -20,6 +20,13 @@ describe('ol.source.XYZ', function() {
|
||||
expect(source).to.be.an(TileSource);
|
||||
});
|
||||
|
||||
it('can be constructed with a custom zDirection', function() {
|
||||
const source = new XYZ({
|
||||
zDirection: -1
|
||||
});
|
||||
expect(source.zDirection).to.be(-1);
|
||||
});
|
||||
|
||||
it('can be constructed with a custom tile grid', function() {
|
||||
const tileGrid = createXYZ();
|
||||
const tileSource = new XYZ({
|
||||
|
||||
Reference in New Issue
Block a user