Changed the zoom relative level for the SVG overlay to avoid issues at higher zoom levels (probably due to rounding errors).

This commit is contained in:
vdv committed 2022-09-21 15:47:57 +02:00
1 parent 7808b7db7e
commit f0cf255f14
2 files changed
+7 -6

No files matched your search

+4 -2
View File
@@ -10,6 +10,8 @@ import {
tile2long,
} from '../lib/geo';
export const zoom0 = 10;
// Top level properties (the other properties can be derived from them)
// The map itself
@@ -19,7 +21,7 @@ export interface MapScope {
}
var initialMapScope: MapScope = {
center: { lat: -37.8403508, lon: 77.5539501 },
zoom: 4,
zoom: 17,
};
// Derived properties
@@ -109,7 +111,7 @@ const evaluateWhiteboardViewBox = (
) => {
// Update the whiteboard SVG viewBox
const scaleFactor = 2 ** state.scope.zoom;
const scaleFactor = 2 ** (state.scope.zoom - zoom0);
state.whiteboard.scale = scaleFactor * tileSize;
state.whiteboard.translation.x =