From ac0d67b2732108a82059a135326a066b55f8d7cb Mon Sep 17 00:00:00 2001 From: ahocevar Date: Tue, 12 Mar 2019 16:51:20 +0100 Subject: [PATCH] Use closest lower source resolution for render tiles --- src/ol/source/VectorTile.js | 2 +- test/spec/ol/source/vectortile.test.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ol/source/VectorTile.js b/src/ol/source/VectorTile.js index e05b933889..112274e30f 100644 --- a/src/ol/source/VectorTile.js +++ b/src/ol/source/VectorTile.js @@ -191,7 +191,7 @@ class VectorTile extends UrlTile { if (sourceExtent) { getIntersection(extent, sourceExtent, extent); } - const sourceZ = sourceTileGrid.getZForResolution(resolution/*, 1*/); + const sourceZ = sourceTileGrid.getZForResolution(resolution, 1); const minZoom = sourceTileGrid.getMinZoom(); let loadedZ = sourceZ + 1; diff --git a/test/spec/ol/source/vectortile.test.js b/test/spec/ol/source/vectortile.test.js index cfc0462ca4..c8965942f1 100644 --- a/test/spec/ol/source/vectortile.test.js +++ b/test/spec/ol/source/vectortile.test.js @@ -105,7 +105,7 @@ describe('ol.source.VectorTile', function() { function tileUrlFunction(tileCoord) { ++requested; - if (tileCoord.toString() == '6,27,-57') { + if (tileCoord.toString() == '5,13,-29') { return tileCoord.join('/'); } } @@ -154,7 +154,7 @@ describe('ol.source.VectorTile', function() { map.renderSync(); setTimeout(function() { expect(requested).to.be.greaterThan(1); - expect(loaded).to.eql(['6/27/-57']); + expect(loaded).to.eql(['5/13/-29']); done(); }, 0); });