diff options
author | Guilhem Moulin <guilhem@fripost.org> | 2024-01-20 17:22:31 +0100 |
---|---|---|
committer | Guilhem Moulin <guilhem@fripost.org> | 2024-01-20 17:29:32 +0100 |
commit | 1bf9fa396b260ea8469000a9356b4839f656d468 (patch) | |
tree | 60851651b04f8284da0703433aa49f2075484a31 | |
parent | 06b6eb91e09e4dfc3f207884d9004d28b882ce1f (diff) |
Factor out ‘resolutions’ array.
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
-rw-r--r-- | main.js | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -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, }); |