You are not logged in.

1

Thursday, April 23rd 2015, 8:40pm

embedpano modifying path to xml

I have the following line in a script tag on my html page:

Quoted

embedpano({swf:"/fullClimb/hi-res/xml/1-1_Panorama.swf", xml:"/fullClimb/hi-res/xml/1-1_Panorama.xml", target:"pano", html5:"prefer", passQueryParameters:true});
However, the viewer seems to be trying to load "/fullClimb/hi-res/xml/../../xml/1-1_Panorama.xml" instead of the path I have entered. Does anyone know why embedpano would interpolate the extra "../../xml" into the path? I have tried a variety of paths and some suffer from this interpolation while others don't. I've attached an image of the error message. Any suggestions would be greatly appreciated!
javi7 has attached the following image:
  • krpanoerror.png

Ibrendie

Trainee

Posts: 68

Location: The Netherlands

  • Send private message

2

Thursday, April 23rd 2015, 8:53pm

I have the following line in a script tag on my html page:

Quoted

embedpano({swf:"/fullClimb/hi-res/xml/1-1_Panorama.swf", xml:"/fullClimb/hi-res/xml/1-1_Panorama.xml", target:"pano", html5:"prefer", passQueryParameters:true});
However, the viewer seems to be trying to load "/fullClimb/hi-res/xml/../../xml/1-1_Panorama.xml" instead of the path I have entered. Does anyone know why embedpano would interpolate the extra "../../xml" into the path? I have tried a variety of paths and some suffer from this interpolation while others don't. I've attached an image of the error message. Any suggestions would be greatly appreciated!
The paths are relative to the html file as stated on this page:

http://krpano.com/docu/html/#embeddingparameters

Where is your html file located?

edit: also, you only need to add the path to the .swf file. The other files will inherit the same path als the .swf file, if the file names correspond. See also the above link.

3

Thursday, April 23rd 2015, 11:03pm

I have a base directory called "fullClimb." Inside of fullClimb, I have a directory called html which contains a file "demo.html" which contains the snipped I quoted above.

I have another directory called "hi-res" which has folders for all my tile images ("1-1_Panorama.tiles", "2-1_Panorama.tiles", etc.) and a folder called "xml" with all of my xml files.

So the relative path from demo.html to 1-1_Panorama.xml is "../hi-res/xml/1-1_Panorama.xml" and the absolute path is "/fullClimb/hi-res/xml/1-1_Panorama.xml"

What is strange to me is that embedpano seems to be inserting stuff into the middle of the path I have specified, looking at "/fullClimb/hi-res/xml/../../xml/1-1_Panorama.xml" rather than "/fullClimb/hi-res/xml/1-1_Panorama.xml" as I specified.

Thanks for the tip on only specifying .swf. I will omit the xml path and keep trying.

Ibrendie

Trainee

Posts: 68

Location: The Netherlands

  • Send private message

4

Friday, April 24th 2015, 12:14pm

I have a base directory called "fullClimb." Inside of fullClimb, I have a directory called html which contains a file "demo.html" which contains the snipped I quoted above.

I have another directory called "hi-res" which has folders for all my tile images ("1-1_Panorama.tiles", "2-1_Panorama.tiles", etc.) and a folder called "xml" with all of my xml files.

So the relative path from demo.html to 1-1_Panorama.xml is "../hi-res/xml/1-1_Panorama.xml" and the absolute path is "/fullClimb/hi-res/xml/1-1_Panorama.xml"

What is strange to me is that embedpano seems to be inserting stuff into the middle of the path I have specified, looking at "/fullClimb/hi-res/xml/../../xml/1-1_Panorama.xml" rather than "/fullClimb/hi-res/xml/1-1_Panorama.xml" as I specified.

Thanks for the tip on only specifying .swf. I will omit the xml path and keep trying.
I've tested it for you. Actually it's really simple:

Source code

1
2
<script src="../pano.js"></script>
<div id="pano" style="width:100%;height:100%;">	<noscript><table style="width:100%;height:100%;"><tr style="vertical-align:middle;"><td><div style="text-align:center;">ERROR:<br/><br/>Javascript not activated<br/><br/></div></td></tr></table></noscript>	<script>		embedpano({swf:"../pano.swf", xml:"../xml/pano.xml", target:"pano", html5:"only", passQueryParameters:true});	</script></div>


Note that you also need to add ../ to pano.js if the js file is located in the root folder.

Furthermore, for your tiles you also need to add something like this (don't pay attention to the file names, those are for my case) :

Source code

1
2
<scene name="pano">        <preview url="../hi-res/pano.tiles/preview.jpg" />
        <image>            <cube url="%SWFPATH%/../hi-res/pano.tiles/pano_%s.jpg" />            <mobile>                <cube url="%SWFPATH%/../hi-res/pano.tiles/mobile_%s.jpg" />            </mobile>        </image>    </scene>


Or use the %SWFPATH% placeholders in the xml.

See: http://www.krpano.com/docu/xml/#url-notes

I don't know if this works in the html, I don't think so. In case of the images in the xml, you would have the following path:

Source code

1
2
<scene name="pano">        <preview url="%SWFPATH%/../hi-res/pano.tiles/preview.jpg" />
        <image>            <cube url="../hi-res/pano.tiles/pano_%s.jpg" />            <mobile>                <cube url="../hi-res/pano.tiles/mobile_%s.jpg" />            </mobile>        </image>    </scene>


It's important to understand that the paths are "relative to the html file" as I stated earlier.

Hope it helps.

This post has been edited 1 times, last edit by "Ibrendie" (Apr 24th 2015, 12:24pm)