diff options
-rw-r--r-- | main.js | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -104,7 +104,6 @@ const baseMapSource = new WMTS({ }); -const resolutions = [1024, 512, 256, 128, 64, 32, 16, 8]; const view = new View({ projection: projection, extent: extent, @@ -113,7 +112,7 @@ const view = new View({ center: [694767.48, 7338176.57], zoom: 1, enableRotation: false, - resolutions: resolutions, + resolutions: [1024, 512, 256, 128, 64, 32, 16, 8], constrainResolution: false, }); @@ -582,7 +581,7 @@ map.addLayer(new VectorTileLayer({ return style; } else { const maxi = style.length - 1; - const z = resolutions.length - 2 - Math.log2(resolution); + const z = 10 /* Math.log2(maxResolution) */ - Math.log2(resolution); /* use Math.floor() as VectorTile.js calls getZForResolution(resolution, 1) */ const i = z <= 0 ? 0 : z >= maxi ? maxi : Math.floor(z); // console.log(`resolution=${resolution}, z=${z}, i=${i}`); |