mpetroff / pannellum

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

Go back to no scene loaded, without destroying the viewer #812

Open martinlombana opened 5 years ago

martinlombana commented 5 years ago

I need, for a very specific case, to return back to the first state of the viewer, where no scene has been loade, because I am loading and unloading scenes dynamically. And I need to go back to an "empty state". I see that there is no viewer.unloadScene method, or something like that. Is there any straight forward way , without having to touch the base lib, to make the viewer unload the current scene, and just show the background with the "No scene Loaded" message?

Thanks!

mpetroff commented 4 years ago

This is not currently supported.

The following three lines should accomplish this, if used internally in pannellum.js:

controls.load.style.display = 'table';
loaded = undefined;
renderContainer.style.display = 'none';
martinlombana commented 4 years ago

Thanks! I missed your answer before.