Sie sind nicht angemeldet.

1

Dienstag, 3. Mai 2011, 17:24

Link to index.html (holds the viewer code) and state in the link url which xml file to use?

Hello.

Is it possible to link to index.html (holds the viewer code) and state in the link url which xml file to use?

I'm converting an old tourism website to use KRPano (currently FPP) and have about 90 X 360 degree images showing off various attractions and locations. Each individual attraction/location page on the website contains info but also a text link 'View the 360 degree image' which opens the viewer in a new window at a set size.

Having just one index.html holding the viewer code and then 90 xml files each with their own specs would cut down so much on the files used online and I can just use 'include' where needed for the plugins/global info.

The url link doesn't need to hold any code other than the index.html + specific xml file.

Thanks,

Andrew

Beiträge: 1 857

Beruf: Virtual Tours - Photography - Krpano developer

  • Nachricht senden

2

Dienstag, 3. Mai 2011, 18:22

Use the example in the krpano folder to get you started.
examples/javascript-interface/js-getlink/getlink.html

Then you can get the get variable to set your xml,, or maybe even use it use one xml.
KRPano Developer: Portfolio ::Gigapixel Tagging Solutions - Porfolio 2 :: Facebook :: Twitter :: reddit.com/r/VirtualTour

3

Dienstag, 3. Mai 2011, 20:37

Thanks for the pointer.

I found and tried the js-getlink example but it didn't display the url locally so uploaded the whole examples folder to my own website and tried it there. Worked fine.

I'll spend some time reading and see how it all works ;-)

Thanks again.

4

Mittwoch, 4. Mai 2011, 01:06

OK, I'm getting somewhere after looking at examples and looks as though It will work with just one index.html file *smile*


I can link directly to each panorama by changing the xml name using

Quellcode

1
/index.html?pano=001.xml


and here's the code for the html page taken from previous examples. Is there any of this code I can remove as it's not needed? Not too sure what the 'krpanologo' is or if I need 'Get player version'?

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<script type="text/javascript">
// <![CDATA[
	if (typeof(deconcept) !== 'undefined' && deconcept.SWFObjectUtil.getPlayerVersion().major >= 6)
	{
		var so = new SWFObject("viewer.swf", "krpanoSWFObject", "870", "445", "9.0.28","#000000");
		so.addParam("allowFullScreen","true");
		so.addParam("allowScriptAccess","sameDomain");
		
		//so.addVariable("pano", getQueryParamValue("pano"));
		
		// pass all external parameters
		var q = document.location.search || document.location.hash;
		if(q)
		{
			var params = q.substring(1).split("&");
			for(var i=0; i<params.length; i++)
			{
				var param = params[i];
				var istgl = param.indexOf("=");
				var pname = param.substring(0,istgl);
				var pval  = param.substring(istgl+1);
				
				if (pname == "krpanologo")
				{
					// shortcut to hide the logo 
					pname = "plugin[krpanologo].visible";
				}
				
				so.addVariable(pname, pval);
			}
		}
		
		so.useExpressInstall('./swfobject/expressinstall.swf');
		so.setAttribute('xiRedirectUrl', window.location);
		if ( so.write("krpano") ) { var mousewheelfixes = new SWFkrpanoMouseWheel(so); }
	}
	else
	{
		document.getElementById("krpano").innerHTML = '<table width="870" height="445"><tr valign="middle"><td><center>ERROR:<br><br>Adobe Flash Player 9 needed<br><br><br><a href="http://www.adobe.com/go/getflashplayer/"  target="_blank"><IMG SRC="http://www.macromedia.com/images/shared/download_buttons/get_flash_player.gif" BORDER="1"></a><br>...click here to download...<br><br><br><br></center></td></tr></table>';
	}
// ]]>
</script>


Thanks,

Andrew