import React, { useState } from "react";
import ReactPannellum, { getConfig } from "react-pannellum";
import Button from "../ui/Button";
const Panorama = () => {
const [config, setConfig] = useState({
autoRotate: -2,
autoLoad: true,
// defaultHfov: 120,
// maxHfov: 120,
// minHfov: 120,
showControls: false,
});
const handleClick = () => {
console.log(getConfig());
};
return (
<ReactPannellum
id="panorama"
sceneId="scene"
// imageSource="/office.jpg"
config={config}
type="cubemap"
cubeMap={[
"/left.jpg",
"/left.jpg",
"/left.jpg",
"/left.jpg",
"/left.jpg",
"/left.jpg",
]}
style={{
width: "500px",
height: "400px",
}}
/>
<Button onClick={handleClick} leftIcon={👋}>
Click Me
);
};
export default Panorama;
the above is code i am using and all the six images i am providing are same. and they exist in my public directory. i am using vite+react with javascript no swc is used.
import React, { useState } from "react";
import ReactPannellum, { getConfig } from "react-pannellum";
import Button from "../ui/Button";
const Panorama = () => {
const [config, setConfig] = useState({
autoRotate: -2,
autoLoad: true,
// defaultHfov: 120,
// maxHfov: 120,
// minHfov: 120,
showControls: false,
});
const handleClick = () => {
console.log(getConfig());
};
return (
<ReactPannellum
id="panorama"
sceneId="scene"
// imageSource="/office.jpg"
config={config}
type="cubemap"
cubeMap={[
"/left.jpg",
"/left.jpg",
"/left.jpg",
"/left.jpg",
"/left.jpg",
"/left.jpg",
]}
style={{
width: "500px",
height: "400px",
}}
/>
<Button onClick={handleClick} leftIcon={👋}>
Click Me
);
};
export default Panorama;
the above is code i am using and all the six images i am providing are same. and they exist in my public directory. i am using vite+react with javascript no swc is used.