diff --git a/web/src/cities/map/canvasDraw.ts b/web/src/cities/map/canvasDraw.ts index 0e0f63c..4476773 100644 --- a/web/src/cities/map/canvasDraw.ts +++ b/web/src/cities/map/canvasDraw.ts @@ -8,8 +8,6 @@ export function drawOnMap( windData: [string, string, string, boolean, WindProps], props: ResolutionPropsValue, ): void { - const boxSize = 80; - const [windDirection, windSpeed, windGusts, roundValues, windProp] = windData; const [bgImg, arrowImg] = imgArr; @@ -24,13 +22,13 @@ export function drawOnMap( ctx.beginPath(); ctx.fillStyle = "#FFFFFF"; - ctx.rect(localX-boxSize/2, localY-boxSize/2, boxSize, boxSize); + ctx.rect(localX-props.boxSize/2, localY-props.boxSize/2, props.boxSize, props.boxSize); ctx.fill(); }); ctx.fill(); // weather values - ctx.font = "bold 30px Rubik"; + ctx.font = `bold ${props.fontSize}px Rubik`; ctx.textAlign = "center"; ctx.textBaseline = "middle"; coords.forEach(([, {x, y}, value]) => { diff --git a/web/src/cities/map/mapConsts.ts b/web/src/cities/map/mapConsts.ts index 00d267c..c824e07 100644 --- a/web/src/cities/map/mapConsts.ts +++ b/web/src/cities/map/mapConsts.ts @@ -13,13 +13,15 @@ export type ResolutionPropsValue = { scale: number; showWind: boolean; map: string; + fontSize: number; + boxSize: number; }; export const resolutionProps: Record = { - "map_1920x1080": { offsetX: 290, offsetY: 120, width: 1920, height: 1080, scale: 1.35, showWind: false, map: map_1920x1080 }, - "map_1920x1080_wind": { offsetX: 90, offsetY: 120, width: 1920, height: 1080, scale: 1.35, showWind: true, map: map_1920x1080_wind }, - "map_3840x1440": { offsetX: 800, offsetY: 120, width: 3840, height: 1440, scale: 2.2, showWind: false, map: map_3840x1440 }, - "map_3840x1440_wind": { offsetX: 800, offsetY: 120, width: 3840, height: 1440, scale: 2.2, showWind: true, map: map_3840x1440_wind }, + "map_1920x1080": { offsetX: 290, offsetY: 120, width: 1920, height: 1080, scale: 1.35, fontSize: 30, boxSize: 80, showWind: false, map: map_1920x1080 }, + "map_1920x1080_wind": { offsetX: 90, offsetY: 120, width: 1920, height: 1080, scale: 1.35, fontSize: 30, boxSize: 80, showWind: true, map: map_1920x1080_wind }, + "map_3840x1440": { offsetX: 800, offsetY: 120, width: 3840, height: 1440, scale: 2.2, fontSize: 68, boxSize: 140, showWind: false, map: map_3840x1440 }, + "map_3840x1440_wind": { offsetX: 800, offsetY: 120, width: 3840, height: 1440, scale: 2.2, fontSize: 68, boxSize: 140, showWind: true, map: map_3840x1440_wind }, } export type WindProps = {