mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 02:56:41 +07:00
fixed adaptive zoom
This commit is contained in:
parent
a1c55befa2
commit
3ca211b9bb
2 changed files with 2 additions and 2 deletions
|
@ -15,7 +15,7 @@ interface IProps {
|
|||
|
||||
const Stickers: FC<IProps> = memo(({ stickers, is_editing, mapSetSticker, mapDropSticker }) => {
|
||||
const [layer, setLayer] = useState<FeatureGroup>(null);
|
||||
const [zoom, setZoom] = useState(16);
|
||||
const [zoom, setZoom] = useState(MainMap.getZoom());
|
||||
|
||||
const onZoomChange = useCallback(
|
||||
(event) => {
|
||||
|
|
|
@ -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))))
|
||||
);
|
Loading…
Add table
Add a link
Reference in a new issue