--
You received this message because you are subscribed to the Google Groups "marzipano" group.
To unsubscribe from this group and stop receiving emails from it, send an email to marzipano+unsubscribe@googlegroups.com.
To post to this group, send email to marz...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/marzipano/a5217b13-c9a4-4c02-b4b8-51be026562d8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You can detect when a scene starts being rendered by listening to the `sceneChange` event on the Viewer object.No event is emitted when rendering is "finished", but there's an indirect way to detect it. Rendering is "finished" once a texture has been loaded for every visible tile. You can determine this by combining Layer#visibleTiles (to get the list of currently visible tiles) and TextureStore#query (to query the loading state of a tile):var layer = viewer.scene().layer();var textureStore = layer.textureStore();var tileList = [];layer.visibleTiles(tileList);for (var i = 0; i < tileList.length; i++) {if (!textureStore.query(tileList[i]).hasTexture) {// not finished yet}}To avoid polling repeatedly, you should run this code in response to the TextureStore `textureLoad` event, which is emitted every time a new texture is loaded.Note that it only makes sense to ask whether rendering is "finished" if the view (i.e. the camera parameters) remains constant. Every time the view changes, new tiles may become visible and start being loaded. In fact, a panorama might be too large to fit entirely in Marzipano's internal cache, so if you continuously move the view around, you may never reach a state where no textures are being loaded.
On Mon, Jun 19, 2017 at 11:43 AM, Michael Simla <msi...@gmail.com> wrote:
Is there any event that is fired when Marzipano starts or is finished rendering a scene?My client wants to have some sort of loading animation(a spinner or something) to indicate that a panorama is loading. I know that Marzipano lazy loads in the preview and then full res images, but my client doesn't think that is enough.thanks,Michael
--
You received this message because you are subscribed to the Google Groups "marzipano" group.
To unsubscribe from this group and stop receiving emails from it, send an email to marzipano+...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to marzipano+unsubscribe@googlegroups.com.
To post to this group, send email to marz...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/marzipano/b765772c-d308-4feb-96e2-4c0435071da0%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to marzipano+unsubscribe@googlegroups.com.
To post to this group, send email to marz...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/marzipano/c1d069be-cde9-4238-ade0-e8636a8d04cd%40googlegroups.com.