From 6d632723ee1af4dba7051faf6f6a486537f1da37 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mi=C5=82osz=20Grocholewski?= <m.grocholewski@atcomp.pl>
Date: Tue, 5 Nov 2024 08:02:10 +0100
Subject: [PATCH] refactor(map): change view zoomFactor (zoom step)

---
 src/components/Map/MapViewer/utils/config/useOlMapView.ts | 5 +++--
 src/components/Map/MapViewer/utils/useOlMap.ts            | 1 +
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/components/Map/MapViewer/utils/config/useOlMapView.ts b/src/components/Map/MapViewer/utils/config/useOlMapView.ts
index ffa0b76e..43e17b5b 100644
--- a/src/components/Map/MapViewer/utils/config/useOlMapView.ts
+++ b/src/components/Map/MapViewer/utils/config/useOlMapView.ts
@@ -56,11 +56,12 @@ export const useOlMapView = ({ mapInstance }: UseOlMapViewInput): MapConfig['vie
       center: [center.x, center.y],
       zoom: mapInitialPosition.z,
       showFullExtent: OPTIONS.showFullExtent,
-      maxZoom: mapSize.maxZoom,
+      zoomFactor: 2 ** (1 / 3),
+      maxZoom: mapSize.maxZoom * 3,
       minZoom: mapSize.minZoom,
       extent,
     }),
-    [mapInitialPosition.z, mapSize.maxZoom, mapSize.minZoom, center, extent],
+    [mapInitialPosition.z, mapSize.maxZoom, center, extent],
   );
 
   const view = useMemo(() => new View(viewConfig), [viewConfig]);
diff --git a/src/components/Map/MapViewer/utils/useOlMap.ts b/src/components/Map/MapViewer/utils/useOlMap.ts
index e80f32ef..8cb003ee 100644
--- a/src/components/Map/MapViewer/utils/useOlMap.ts
+++ b/src/components/Map/MapViewer/utils/useOlMap.ts
@@ -54,6 +54,7 @@ export const useOlMap: UseOlMap = ({ target } = {}) => {
       }).extend([
         new MouseWheelZoom({
           duration: 0,
+          timeout: 20,
         }),
       ]),
       target: target || mapRef.current,
-- 
GitLab