Elius94 / react-photo-sphere-viewer

Photosphere Viewer for React.JS
MIT License
65 stars 21 forks source link

[Bug]: defaultZoomLvl not working #61

Closed devinmarkley closed 1 month ago

devinmarkley commented 1 month ago

What happened?

When setting defaultZoomLvl to zero, my image uses the default zoom of 50.

What should have happened?

The image should be all the way zoomed out at the default level of 0

Code

`import React from "react"; import { ReactPhotoSphereViewer } from "react-photo-sphere-viewer"; import image from "./images/somePano.JPG";

export default function ImageViewer() { const pSRef = React.createRef();

return ( <> <ReactPhotoSphereViewer ref={pSRef} width={"100vw"} height={"100vh"} container={"container-360"} src={image} navbar={false} defaultZoomLvl={0} /> </> ); };`

Sandbox Link

No response

Library Version

"react-photo-sphere-viewer": "^6.0.0",
"react-quiz-component": "^0.8.2",

What operating system are you using?

macOS

What browser are you using?

Chrome

Logs

No response

Interest to fix the bug

Elius94 commented 1 month ago

Please, make me a sandbox, so I can easily help you

devinmarkley commented 1 month ago

Sorry about that here is a link to my sandbox

https://codesandbox.io/p/github/devinmarkley/rps_example/main?import=true

Elius94 commented 1 month ago

Edit condescending-bush-zlvk8c

please see this :) for me it works

devinmarkley commented 1 month ago

I looked into this more deeply today to see why your version was working, and mine was not. Setting the default zoom level to 0 only works for images in the public directory.

Here's a link to my example

https://codesandbox.io/p/github/devinmarkley/rps_example/main?import=true

If you uncomment src={"Test_Pano.jpg"} the zoom level will be set to zero, but using the import image, it will use the default zoom of 50.