|
@@ -9,6 +9,8 @@ import {
|
|
|
savePanoPositionToLocalStorage,
|
|
|
savePanoPovToLocalStorage,
|
|
|
} from "../../../domain/localStorageMethods";
|
|
|
+import { useGameConfig } from "../../../hooks/useGameInfo";
|
|
|
+import { FROZEN } from "../../../domain/constants";
|
|
|
/* global google */
|
|
|
|
|
|
export const useFirstSubmitter = (rate, cutoffTime) => {
|
|
@@ -57,8 +59,12 @@ export const useIsFinished = () => {
|
|
|
};
|
|
|
|
|
|
export const usePano = (panoDivRef, { lat, lng }, { heading, pitch }) => {
|
|
|
+ const { gameMode } = useGameConfig();
|
|
|
const panoRef = useRef(null);
|
|
|
useEffect(() => {
|
|
|
+ if (gameMode === undefined) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
const position = { lat, lng };
|
|
|
const pov = { heading, pitch };
|
|
|
if (panoRef.current) {
|
|
@@ -67,18 +73,28 @@ export const usePano = (panoDivRef, { lat, lng }, { heading, pitch }) => {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+ const settings =
|
|
|
+ gameMode === FROZEN
|
|
|
+ ? {
|
|
|
+ disableDefaultUI: true,
|
|
|
+ panControl: true,
|
|
|
+ zoomControl: true,
|
|
|
+ clickToGo: false,
|
|
|
+ }
|
|
|
+ : { clickToGo: true };
|
|
|
+
|
|
|
panoRef.current = new google.maps.StreetViewPanorama(panoDivRef.current, {
|
|
|
position,
|
|
|
pov,
|
|
|
fullscreenControl: false,
|
|
|
addressControl: false,
|
|
|
showRoadLabels: false,
|
|
|
- clickToGo: true,
|
|
|
visible: true,
|
|
|
motionTracking: false,
|
|
|
motionTrackingControl: false,
|
|
|
+ ...settings,
|
|
|
});
|
|
|
- }, [panoDivRef, lat, lng, heading, pitch]);
|
|
|
+ }, [gameMode, panoDivRef, lat, lng, heading, pitch]);
|
|
|
|
|
|
return panoRef;
|
|
|
};
|