From e50311bf775fa00b8733a65b7d8ff751291ba446 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=95=EC=9A=A9=EC=A4=80?= Date: Wed, 17 Apr 2024 14:39:02 +0900 Subject: [PATCH] fix: apply center, zoom changes to the map --- src/components/GoogleMap/index.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/GoogleMap/index.tsx b/src/components/GoogleMap/index.tsx index 35aec6a..844ff52 100644 --- a/src/components/GoogleMap/index.tsx +++ b/src/components/GoogleMap/index.tsx @@ -67,9 +67,9 @@ export const GoogleMap = forwardRef(function Go } const map = new mapsLib.Map(containerRef.current!, { + ...mapOptions, center: initialCenter || center || mapOptions.center, zoom: initialZoom || zoom || mapOptions.zoom, - ...mapOptions, }); setMap(map); @@ -80,6 +80,8 @@ export const GoogleMap = forwardRef(function Go useApplyMapOptions(map, { ...mapOptions, + center: center || mapOptions.center, + zoom: zoom || mapOptions.zoom, }); useApplyMapEvent(map, {