Loading ...
Sorry, an error occurred while loading the content.

ptviewer: How to avoid flickering when switching panos?

Expand Messages
  • Jan Martin
    Hi all, I think I solved the pan tilt fov issues I had with ptviewer. However one issue is left: When switching panos there is a short period of white
    Message 1 of 1 , Jun 28, 2009
    • 0 Attachment
      Hi all,

      I think I solved the pan tilt fov issues I had with ptviewer.

      However one issue is left:
      When switching panos there is a short period of white background.
      Because I preload the image and switch only when it is loaded this seems to
      be a ptviewer issue?

      Any ideas how to solve this?

      Thanks,
      Jan

      Relevant code so far:

      function nextpano() {
      nextimage = nextimage+1;

      nextimagefilename='panos/'+zeroPad(nextimage,8)+'.jpg';

      // NO preloading
      // switchpano(nextimagefilename);

      /* PRELOADING
      buffer = new Image();
      buffer.src=nextimagefilename;

      // testing: No difference between: onLoad and complete
      //buffer.src.onLoad = switchpano(buffer.src);
      buffer.src.complete = switchpano(buffer.src);
      */
      }

      function switchpano(loadedimage) {

      pan =document.ptviewer.pan();
      tilt=document.ptviewer.tilt();
      fov =document.ptviewer.fov();

      nextstring ='{file='+loadedimage+'} {pan='+pan+'} {tilt='+tilt+'}
      {fov='+fov+'}';

      document.ptviewer.newPano(nextstring);
      }


      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.