From 38ff55f2039b76ce57556bf0da56f1a698110f9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carl-Gerhard=20Lindesva=CC=88rd?= Date: Thu, 20 Mar 2025 20:52:49 +0100 Subject: [PATCH] fix(dashboard): set initial size for map --- .../[organizationSlug]/[projectId]/realtime/map/map.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/realtime/map/map.tsx b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/realtime/map/map.tsx index a66bf3e1..793031da 100644 --- a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/realtime/map/map.tsx +++ b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/realtime/map/map.tsx @@ -70,6 +70,15 @@ const Map = ({ markers }: Props) => { }); }, []); + useEffect(() => { + if (ref.current) { + setSize({ + width: ref.current.clientWidth, + height: ref.current.clientHeight, + }); + } + }, []); + const adjustSizeBasedOnZoom = (size: number) => { const minMultiplier = 1; const maxMultiplier = 7;