Open randypng opened 8 years ago
I'm sure Matthew will be along shortly to answer your question more fully, but the functionloadScene
was made "public" in a later software update/commit (around Mar 12, 2016, commit 77816b after the version on the CDN which is release 2.2.1 on Mar 11, 2016). To see the latest behavior, you'll need to download the source files and build them on your computer (if you use Linux, it's a breeze) then upload the 3 resulting "built" files to your own server and reference those in your html file.
Let me edit and clarify... you can also upload the source files located here to your server and use those directly, changing the src tag in your html to point to your server. You only need to download and build the sources if you want "minimized"/compacted versions of the files (using minimized version shortens page load time).
Finally, I don't use this method myself, but if you must use the CDN release, you might consider using the pannellum API (documented here) to "destroy" the current viewer and simply create a new one (adding autoLoad
) with a new image in the same div
. Your thumbnail can simply be a link to invoke this via an onclick
event.You won't have benefit of hotSpots
and other scene attributes, but something as simple as this might work for you (there may be a more "proper" way to do this):
function myLoadScene (imagePath,myPitch,myYaw,myHfov) {
viewer.getRenderer().destroy(); // relies on global viewer
viewer=pannellum.viewer('panorama', {
"type": "equirectangular",
"hfov": myHfov,
"pitch": myPitch,
"yaw": myYaw,
"panorama": imagePath,
"autoLoad": true
});
};
While the loadScene workaround may do the job, it's probably best to keep updated with the latest sources as Matthew is quick to respond to identified issues.
As @MmmDee mentioned, the loadScene
method is currently only public in the development version.
Hmm.. I'm actually using the development version, cos' I'm extending the functionality to suit my needs.
I guess the most elegant way right now, is to have an additional configuration called "sceneThumbnail", and another function to get all the thumbnails and load them onto a specific location in the viewer.
Seems that the API doesn't have a function to loop through all available scenes and get that specific config data, though.
Ah I found it. Apparently I forgot about JSON.stringify
Hello
I'm building a Panorama with thumbnails on the side. Having a little trouble trying to deep link into the container. Unfortunately, loadScene seems to be a private function hence I'm kinda lost.
Any suggestions??