Synchronise viewers - how to synchronise more than two viewers

  • Hi,

    a good, and relative simple, option is to use the layer type krpano for such.
    https://krpano.com/docu/xml/#layer.type

    I have done this and it works just great.

    Tuur *thumbsup*

  • Hi,

    a good, and relative simple, option is to use the layer type krpano for such.
    https://krpano.com/docu/xml/#layer.type

    I have done this and it works just great.

    Tuur *thumbsup*

    Hi Tuur!
    it seems reasonable to use layers in this case, but how do you then synchronise all the views (in individual layers) in a way that all (in my case 4) views are synchronised and the view can be controlled from any one of them. That's what I have been struggling with, I have been trying to modify sync.xml from https://krpano.com/releases/1.20.5/examples/#js-sync-viewer, but I haven't really sucseeded *pinch* . Thanks

    Venca

  • I managed to do it using a modified version of the syncscreen example.
    Basically, I modified the sync.xml to take an array of syncviewers and loop through the array to update the other views:

    and for the html:

  • I managed to do it using a modified version of the syncscreen example.
    Basically, I modified the sync.xml to take an array of syncviewers and loop through the array to update the other views:

    Code

    and for the html:

    Code
    embedpano({html5:"only", consolelog:true, basepath:"../../../", id:"pano1viewer",  target:"div1",  xml:"pano1.xml", vars:{syncside:"pano1",syncviewer:"pano2viewer,pano3viewer,pano4viewer"}, passQueryParameters:true});
    		embedpano({html5:"only", consolelog:true,basepath:"../../../", id:"pano2viewer", target:"div2", xml:"pano2.xml", vars:{syncside:"pano2",syncviewer:"pano1viewer,pano3viewer,pano4viewer"}, passQueryParameters:true});
    		embedpano({html5:"only", consolelog:true,basepath:"../../../", id:"pano3viewer", target:"div3", xml:"pano3.xml", vars:{syncside:"pano3",syncviewer:"pano1viewer,pano2viewer,pano4viewer"}, passQueryParameters:true});
    		embedpano({html5:"only", consolelog:true,basepath:"../../../", id:"pano4viewer", target:"div4", xml:"pano4.xml", vars:{syncside:"pano4",syncviewer:"pano1viewer,pano2viewer,pano3viewer"}, passQueryParameters:true});

    Awesome, working fine here, thanks kme, highly appreciated *w00t*

  • One way to do this is through webgl shaders.
    Better performance for multiple identical views.
    https://shader-split.vercel.app/

    Another option is to use multiple layers of type "krpano". The plug-in will be released soon, but it currently only supports two views.
    https://contrast-plugin.vercel.app/pano.html

    If you have a customization requirement, we can talk about it. *wink*

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!