|
@@ -3,6 +3,7 @@ import { useRef, useEffect } from "react";
|
|
|
|
|
|
export default (panoDivRef, position) => {
|
|
|
const panoRef = useRef(null);
|
|
|
+ const { lat, lng } = position;
|
|
|
useEffect(() => {
|
|
|
if (panoRef.current) {
|
|
|
console.log("Attempted to create a new Pano");
|
|
@@ -10,13 +11,13 @@ export default (panoDivRef, position) => {
|
|
|
}
|
|
|
|
|
|
panoRef.current = new google.maps.StreetViewPanorama(panoDivRef.current, {
|
|
|
- position,
|
|
|
+ position: { lat, lng },
|
|
|
addressControl: false,
|
|
|
showRoadLabels: false,
|
|
|
clickToGo: true,
|
|
|
visible: true,
|
|
|
});
|
|
|
- }, [panoDivRef, position]);
|
|
|
+ }, [panoDivRef, lat, lng]);
|
|
|
|
|
|
return panoRef;
|
|
|
}
|