Open aproni34f opened 1 year ago
When constructing a viewer with a multires panorama and autoLoad: true
, the panorama will be considered loaded before the pannellum.viewer
returns. Thus, there is little reason to have an event listener for this. You could accomplish the same thing by just calling your event handler manually with something along the lines of:
var viewer = pannellum.viewer('panorama', {...});
function loadHandler () {
console.log("load");
}
viewer.on('load', loadHandler);
loadHandler();
Alternatively, instead of setting autoLoad: true
, just call viewer.loadScene();
after adding your event listener.
So with multires, Is there a way of actually knowing when the scene has loaded (maybe with some code mod) so I can fade in scene nicelly?
You can query the loading status with viewer.getRenderer().isLoading()
.
However, tile loading is linked to rendering for performance reasons, so a scene won't load if it isn't being rendered.
Hi, I have an issue caching load event (with autoLoad:true) when using multires panaorama.
The load event fires before the code viewer.on('load'....
If I add little delay with setTimeout in pannellum.js to this line fireEvent('load'); then load event works with following code, but this is not something I want to do.
Is there a way I can rewrite this code so I can hear the load event after I init panorama? How could I attach listener before I actually set pano data to load?