diff --git a/MapView/index.tsx b/MapView/index.tsx index b6103388cb754744487fff9a9e15fab35126ee63..556a453896daa38f89daeddea543a201749c33e3 100644 --- a/MapView/index.tsx +++ b/MapView/index.tsx @@ -60,14 +60,16 @@ const MapView: React.ForwardRefRenderFunction< () => { if (!containerRef.current) return; const { width, height } = containerRef.current?.getBoundingClientRect(); - console.log('地图宽高变更'); - setMapSize({ - width: width, - height: height, - }); + + if (width !== previous?.width || height !== previous?.height) { + setMapSize({ + width: width, + height: height, + }); + } }, { - wait: 500, + wait: 1000, }, );