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

Merge branch 'feat/MIN-60-zoom-problem-small-maps' into 'development'

feat(map-view): set max zoom for small maps

Closes MIN-60

See merge request !294
parents 86f1cac5 9d6c0a63
No related branches found
No related tags found
1 merge request!294feat(map-view): set max zoom for small maps
Pipeline #97360 passed
......@@ -57,11 +57,23 @@ export const useOlMapView = ({ mapInstance }: UseOlMapViewInput): MapConfig['vie
zoom: mapInitialPosition.z,
showFullExtent: OPTIONS.showFullExtent,
zoomFactor: 2 ** (1 / 3),
maxZoom: mapSize.maxZoom * 3,
maxZoom:
mapSize.width < 1.5 * mapSize.tileSize || mapSize.height < 1.5 * mapSize.tileSize
? Math.max(15, mapSize.maxZoom * 3)
: mapSize.maxZoom * 3,
minZoom: mapSize.minZoom,
extent,
}),
[mapInitialPosition.z, mapSize.maxZoom, center, extent],
[
center,
mapInitialPosition.z,
mapSize.width,
mapSize.tileSize,
mapSize.height,
mapSize.maxZoom,
mapSize.minZoom,
extent,
],
);
const view = useMemo(() => new View(viewConfig), [viewConfig]);
......
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