Added a reset for the map when the source is changed
This commit is contained in:
parent
974e39a2e6
commit
c1d4e09cb3
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user