loadpano from a different domain

  • Hi,
    I am using a content delivery network and I'm storing panoramas in separate containers which means each panorama has its own URL. I would like to add hotspots to some panoramas which load another panorama when clicked. Something like:

    Code
    <hotspot name="spot_1"
      url="%SWFPATH%/images/hotspsot_marker.png"
     keep="false"
     ath="117.2897" atv="24.1219"
     width="36" height="36"
     scale="1" scale9grid="" scalechildren="false" rotate="0"
     visible="true" enabled="true" handcursor="true" capture="true" children="true"
     onhover="showtext(Click to view this panorama);"
      onclick="loadpano('http://cdn.002.host.com/pano.xml', null, MERGE, blend(1));"
     />


    When I use this code, the krpano viewer tries to load http://cdn.001.host.com/http:/cdn.002.host.com/pano.xml
    That is, it's prepending the current panorama path to the URL and dropping a forward slash after the http on the new URL.

    I tried numerous attempts at escaping the double forward slash but couldn't work it out. Any suggestions on this or advice on whether loadpano() can actually load from another domain would be much appreciated.

    Thanks,
    Andrew

  • Hi Klaus, I will pm you a link to an online example. I have a crossdomain.xml file on the domain where the host document resides and in the CDN containers of each pano. Just to explain my setup more clearly. I have a html page that contains an iframe. The source of the iframe points to a container on the CDN that holds the files (html, swf, images, xml etc.) for a pano. Each pano container is assigned a sub-domain by the CDN, so to refer to them I have to give the full http path.

    Code
    http://www.mywebsite.com/index.html -- contains iframe pointing first pano on cdn)
    http://cdn.001.host.com/index.html -- first pano, contains hotspot with loadpano(second pano)
    http://cdn.002.host.com/pano.xml -- xml of second pano


    I tried another way by keeping all the files on the same domain with the panos in separate sub-folders and the loadpano() call on the hotspot using a fully qualified path to the second pano:

    Code
    http://www.mywebsite.com/index.html -- contains iframe pointing first pano on cdn)
    http://www.mywebsite.com/pano1/index.html -- first pano, contains hotspot with loadpano(http://www.mywebsite.com/pano2/pano.xml)
    http://www.mywebsite.com/pano2/pano.xml -- xml of second pano


    Similarly, the viewer tries to load http://www.mywebsite.com/http:/www.mywe…/pano2/pano.xml and gives the error "Loading error - (IO Error)"

    regards,
    Andrew

Participate now!

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