adaptive sticker scale

This commit is contained in:
Fedor Katurov 2020-02-11 15:35:13 +07:00
parent ef5cd0cdef
commit a1c55befa2
5 changed files with 22 additions and 9 deletions

View file

@ -11,4 +11,8 @@ export const getStyle = (oElm: any, strCssRule: string): string => {
export const getRandomColor = () => {
return `hsla(${(Math.floor(Math.random() * 360))}, 100%, 50%, 0.4)`
}
}
export const getAdaptiveScale = (zoom: number): number => (
Math.min(1, Math.max(0.4, 1 / (2 ** (13 - zoom))))
);