mpetroff / pannellum

Pannellum is a lightweight, free, and open source panorama viewer for the web.
https://pannellum.org/
MIT License
4.21k stars 716 forks source link

Need help using Pannellum tour #711

Open Giedrius1991 opened 5 years ago

Giedrius1991 commented 5 years ago

Hi,

im complete newbie in java and html, but what we are trying to do is to use pannellum for our panoramic images captured by a car and create a tour which lets you create a "drive through". I managed to load single panoramic image using example.html but i get problems when i want to use multiple images. I get the initial image loaded but when i click on an arrow i just get "loading" forever. Can somebody write me an .json example of how to correctly use multiple images and create a tour?

mpetroff commented 5 years ago

There's already a tour example: https://pannellum.org/documentation/examples/tour/

Giedrius1991 commented 5 years ago

When i try to go to second image im getting error:

pannellum.js:449 Uncaught TypeError: Cannot read property '0' of undefined at absoluteURL (pannellum.js:449) at init (pannellum.js:362) at load (pannellum.js:2156) at loadScene (pannellum.js:2232) at Image.fadeImg.onload (pannellum.js:2183) absoluteURL @ pannellum.js:449 init @ pannellum.js:362 load @ pannellum.js:2156 loadScene @ pannellum.js:2232 fadeImg.onload @ pannellum.js:2183 load (async) loadScene @ pannellum.js:2182 div.onclick.div.ontouchend @ pannellum.js:1691

mpetroff commented 5 years ago

Without context, a stack trace isn't particularly helpful. It seems that you're not providing a URL for you second panorama.

Giedrius1991 commented 5 years ago

i have tried to create new .html using API example from pannellum examples and now im getting the following error when i try to load initial panorama:

pannellum.js:89 [Deprecation] The deviceorientation event is deprecated on insecure origins, and support will be removed in the future. You should consider switching your application to a secure origin, such as HTTPS. See https://goo.gl/rStTGz for more details. Ba @ pannellum.js:89 viewer @ pannellum.js:101 (anonymous) @ test.html:20

pannellum.js:41 GET http://192.168.1.104/examplepiano.jpg 404 (Not Found) Na @ pannellum.js:41
  Q @ pannellum.js:78
  (anonymous) @ pannellum.js:87
mpetroff commented 5 years ago

Okay, well you've specified a configuration file with http://192.168.1.104/examplepiano.jpg as the panorama image, but you don't have an image file at that location.

Giedrius1991 commented 5 years ago

Thanks for explanation.

now the question is how should folder tree look, or where should "images" folder be located by looking at example ""panorama": "/images/from-tree.jpg"," ? or this is somehow configurable from where the images will be accessed/accesible? Now im using XAMPP to set up local server.

mpetroff commented 5 years ago

You can put the images wherever you like. A long as they're served from the same domain, it should work; you need CORS properly set up if you want to use a different domain.

psteph801 commented 5 years ago

Do the images have to be served from the same domain. What if I wanted to host the images somewhere else like AWS? and have the configuration file in Github?

psteph801 commented 5 years ago

I can get the IFrame to work with one image but not when I create a JSON file.

mpetroff commented 5 years ago

@psteph801 That sounds like a CORS issue. You should be able to verify that using your browser's developer tools; an error would be printed to console, and you can check the headers using the network monitor.