From 1bf9fa396b260ea8469000a9356b4839f656d468 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Sat, 20 Jan 2024 17:22:31 +0100 Subject: =?UTF-8?q?Factor=20out=20=E2=80=98resolutions=E2=80=99=20array.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit And limit it to 8 meter / pixel since that's the highest resolution of Lantmäteriet's “Topografisk Webbkarta Visning, översiktlig” (open data) product. https://www.lantmateriet.se/globalassets/geodata/geodatatjanster/tb_twk_visning-oversiktlig_v1.0.3.pdf --- main.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/main.js b/main.js index c0d0dfb..f5cf41a 100644 --- a/main.js +++ b/main.js @@ -92,11 +92,11 @@ const baseMapSource = new WMTS({ format: 'image/png', tileGrid: new WMTSTileGrid({ extent: extent, - // https://www.lantmateriet.se/globalassets/geodata/geodatatjanster/tb_twk_visning_cache_v1.1.0.pdf + // https://www.lantmateriet.se/globalassets/geodata/geodatatjanster/tb_twk_visning-oversiktlig_v1.0.3.pdf tileSize: 256, origin: [-1200000, 8500000], - resolutions: [4096, 2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1, .5], - matrixIds: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13], + resolutions: [4096, 2048, 1024, 512, 256, 128, 64, 32, 16, 8], + matrixIds: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], }), projection: projection, wrapX: false, @@ -104,6 +104,7 @@ const baseMapSource = new WMTS({ }); +const resolutions = [1024, 512, 256, 128, 64, 32, 16, 8]; const view = new View({ projection: projection, extent: extent, @@ -112,7 +113,7 @@ const view = new View({ center: [694767.48, 7338176.57], zoom: 1, enableRotation: false, - resolutions: [1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1, .5], + resolutions: resolutions, constrainResolution: false, }); -- cgit v1.2.3