From 3ca211b9bbe9bf544b57c75ac2158b2367e54ad4 Mon Sep 17 00:00:00 2001 From: Fedor Katurov Date: Tue, 11 Feb 2020 15:38:53 +0700 Subject: [PATCH] fixed adaptive zoom --- src/map/Stickers/index.tsx | 2 +- src/utils/dom.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/map/Stickers/index.tsx b/src/map/Stickers/index.tsx index 0d155bc..3cee214 100644 --- a/src/map/Stickers/index.tsx +++ b/src/map/Stickers/index.tsx @@ -15,7 +15,7 @@ interface IProps { const Stickers: FC = memo(({ stickers, is_editing, mapSetSticker, mapDropSticker }) => { const [layer, setLayer] = useState(null); - const [zoom, setZoom] = useState(16); + const [zoom, setZoom] = useState(MainMap.getZoom()); const onZoomChange = useCallback( (event) => { diff --git a/src/utils/dom.ts b/src/utils/dom.ts index a75ae01..59248bc 100644 --- a/src/utils/dom.ts +++ b/src/utils/dom.ts @@ -14,5 +14,5 @@ export const getRandomColor = () => { } export const getAdaptiveScale = (zoom: number): number => ( - Math.min(1, Math.max(0.4, 1 / (2 ** (13 - zoom)))) + Math.min(1, Math.max(0.4, 1.5 / (2 ** (13 - zoom)))) ); \ No newline at end of file