Fix bug with map transform resetting when a new resolution is loaded
This commit is contained in:
parent
5ba4817398
commit
5e6f3537b4
@ -76,7 +76,7 @@ function MapInteraction({
|
||||
// Reset transform when map changes
|
||||
useEffect(() => {
|
||||
const layer = mapLayerRef.current;
|
||||
if (map && layer) {
|
||||
if (map && layer && !mapLoaded) {
|
||||
const mapHeight = stageWidthRef.current * (map.height / map.width);
|
||||
const newTranslate = {
|
||||
x: 0,
|
||||
@ -89,7 +89,7 @@ function MapInteraction({
|
||||
|
||||
setStageScale(1);
|
||||
}
|
||||
}, [map]);
|
||||
}, [map, mapLoaded]);
|
||||
|
||||
const pinchPreviousDistanceRef = useRef();
|
||||
const pinchPreviousOriginRef = useRef();
|
||||
|
Loading…
Reference in New Issue
Block a user