diff --git a/src/components/Map.js b/src/components/Map.js index 6d41743..0d3ad8a 100644 --- a/src/components/Map.js +++ b/src/components/Map.js @@ -72,6 +72,12 @@ function Map({ ); } + // Reset map transform when map changes + useEffect(() => { + setMapTranslate({ x: 0, y: 0 }); + setMapScale(1); + }, [mapSource]); + const mapRef = useRef(null); const rows = mapData && mapData.rows; const tokenSizePercent = (1 / rows) * 100;