Improve MineGeo UI and application flows
Some checks failed
Deploy MineGeo to Dokploy / deploy (push) Failing after 2m37s
Some checks failed
Deploy MineGeo to Dokploy / deploy (push) Failing after 2m37s
This commit is contained in:
@@ -15,11 +15,13 @@ void main(){vec3 d=normalize(vDirection);vec3 a=abs(d);vec2 uv;vec4 color;if(a.x
|
||||
export function Panorama({
|
||||
urls,
|
||||
zoom,
|
||||
pan = true,
|
||||
onReady,
|
||||
onError,
|
||||
}: {
|
||||
urls: string[];
|
||||
zoom: boolean;
|
||||
pan?: boolean;
|
||||
onReady: () => void;
|
||||
onError: (message: string) => void;
|
||||
}) {
|
||||
@@ -39,7 +41,7 @@ export function Panorama({
|
||||
const element = mount.current!;
|
||||
view.current = { yaw: 0, pitch: 0, fov: 80 };
|
||||
const down = (e: PointerEvent) => {
|
||||
if (e.button !== 0 || drag) return;
|
||||
if (!pan || e.button !== 0 || drag) return;
|
||||
element.setPointerCapture(e.pointerId);
|
||||
drag = { x: e.clientX, y: e.clientY, pointerId: e.pointerId };
|
||||
},
|
||||
@@ -160,14 +162,18 @@ export function Panorama({
|
||||
renderer?.dispose();
|
||||
renderer?.domElement.remove();
|
||||
};
|
||||
}, [urls, zoom]);
|
||||
}, [urls, zoom, pan]);
|
||||
return (
|
||||
<>
|
||||
<div
|
||||
className="panorama"
|
||||
ref={mount}
|
||||
data-native-cursor
|
||||
aria-label={t("360 degree panorama: drag to look around")}
|
||||
aria-label={t(
|
||||
pan
|
||||
? "360 degree panorama: drag to look around"
|
||||
: "Fixed panorama view",
|
||||
)}
|
||||
/>
|
||||
{
|
||||
<div className="panorama-controls">
|
||||
|
||||
Reference in New Issue
Block a user