Sie sind nicht angemeldet.

1

Mittwoch, 24. November 2010, 07:03

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:

Quellcode

1
2
3
4
5
6
7
8
9
10
<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

2

Mittwoch, 24. November 2010, 16:41

Hi,

do you have an online example?
and do you have a crossdomain.xml on the other server?

best regards,
Klaus

3

Donnerstag, 25. November 2010, 23:42

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.

Quellcode

1
2
3
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:

Quellcode

1
2
3
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.myweb…/pano2/pano.xml and gives the error "Loading error - (IO Error)"

regards,
Andrew

4

Freitag, 26. November 2010, 02:35

I think setting basedir="" has solved the problem:

Quellcode

1
<krpano version="1.0.8" basedir="">

Zitat

basedir - Defines the base directory for the loadpano() actions.
This is working on my local xampp server, will try on hosted site & CDN...

Ähnliche Themen