Skip to content
Snippets Groups Projects
Commit 6d632723 authored by Miłosz Grocholewski's avatar Miłosz Grocholewski
Browse files

refactor(map): change view zoomFactor (zoom step)

parent 281a064f
No related branches found
No related tags found
1 merge request!295refactor(map): change view zoomFactor (zoom step)
...@@ -56,11 +56,12 @@ export const useOlMapView = ({ mapInstance }: UseOlMapViewInput): MapConfig['vie ...@@ -56,11 +56,12 @@ export const useOlMapView = ({ mapInstance }: UseOlMapViewInput): MapConfig['vie
center: [center.x, center.y], center: [center.x, center.y],
zoom: mapInitialPosition.z, zoom: mapInitialPosition.z,
showFullExtent: OPTIONS.showFullExtent, showFullExtent: OPTIONS.showFullExtent,
maxZoom: mapSize.maxZoom, zoomFactor: 2 ** (1 / 3),
maxZoom: mapSize.maxZoom * 3,
minZoom: mapSize.minZoom, minZoom: mapSize.minZoom,
extent, extent,
}), }),
[mapInitialPosition.z, mapSize.maxZoom, mapSize.minZoom, center, extent], [mapInitialPosition.z, mapSize.maxZoom, center, extent],
); );
const view = useMemo(() => new View(viewConfig), [viewConfig]); const view = useMemo(() => new View(viewConfig), [viewConfig]);
......
...@@ -54,6 +54,7 @@ export const useOlMap: UseOlMap = ({ target } = {}) => { ...@@ -54,6 +54,7 @@ export const useOlMap: UseOlMap = ({ target } = {}) => {
}).extend([ }).extend([
new MouseWheelZoom({ new MouseWheelZoom({
duration: 0, duration: 0,
timeout: 20,
}), }),
]), ]),
target: target || mapRef.current, target: target || mapRef.current,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment