Sie sind nicht angemeldet.

  • »jeromebg« ist der Autor dieses Themas

Beiträge: 1 120

Wohnort: Angers - France

Beruf: 360 experiences creator

  • Nachricht senden

1

Mittwoch, 29. September 2010, 17:34

Take hlookat vlookat and fov from the url ?

Hi, I'm trying to reproduce what has been done on http://www.paris-26-gigapixels.com and it's "Share you position' feature (naughty me...)
It's allright to record the position, create an url and send it on facebook, but the problem is that the params in the url aren't read by the player...
the url goes like this :

Quellcode

1
http://www.360images.fr/360/angers_haute_def/angers.html?x=27&y=3&z=19

and x , y and z doesn't mean anything to krpano !
I'm missing something but I just can't find what...
Thanx for your help in advance !!!

PS: you can try the share your position button here :http://www.360images.fr/360/angers_haute_def/angers.html

  • »jeromebg« ist der Autor dieses Themas

Beiträge: 1 120

Wohnort: Angers - France

Beruf: 360 experiences creator

  • Nachricht senden

2

Mittwoch, 29. September 2010, 18:49

Ok, i'm just missing a javascript function to get param from the adress bar (function setView()) but I just can't find it ...
I guess it says hlookat =x vlookat=y fov=z but I just don't know anything about java...

3

Donnerstag, 30. September 2010, 07:13

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
var qs = window.location.search.substring(1);
var qs_parts = qs.split('&');
var qs_params = [];
var tmp;
for (var i=0;i<qs_parts.length;++i) {
  tmp = qs_parts[i].split('=');
  qs_params[tmp[0]] = tmp[1];
}

// Now query string parameters should be available as
// qs_params['x'];
// qs_params['y'];
// qs_params['z'];
alert('x is '+qs_params['x']+', y is '+qs_params['y']+', z is '+qs_params['z']);

  • »jeromebg« ist der Autor dieses Themas

Beiträge: 1 120

Wohnort: Angers - France

Beruf: 360 experiences creator

  • Nachricht senden

4

Donnerstag, 30. September 2010, 14:00

Thanx risa, but the only thing your script tells me when I try http://www.360images.fr/360/angers_haute…l?x=27&y=3&z=19 for example is "x is 27, y is 3, z is 19"...
So it reads all right the url but don't tell krpano.swf to take thoses parmas...
Or maybe i'm doing something wrong ?

5

Donnerstag, 30. September 2010, 15:44

Not sure that this will work but try this:

Quellcode

1
2
3
4
5
var so = createswf('krpano.swf'); // this line might be different for you
so.addVariable('xml', 'your.xml'); // this line might be different for you
so.addVariable('view.hlookat', qs_params['x']);
so.addVariable('view.vlookat', qs_params['y']);
so.addVariable('view.fov', qs_params['z']);

  • »jeromebg« ist der Autor dieses Themas

Beiträge: 1 120

Wohnort: Angers - France

Beruf: 360 experiences creator

  • Nachricht senden

6

Donnerstag, 30. September 2010, 16:30

Wouhouuuuuuuuuuuuuuuuuuuu, brilliant srisa !!!!
It's almost working !!!
Works perfect if the paramas x y z are in the url, but if there is no paramas then it displays a black screen loading and loading again...
Guess it needs a "if" somewhere ?

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
	// <![CDATA[
		if (typeof(deconcept) !== 'undefined' && deconcept.SWFObjectUtil.getPlayerVersion().major >= 6)
		{
		var qs = window.location.search.substring(1);
		var qs_parts = qs.split('&');
		var qs_params = [];
		var tmp;
		for (var i=0;i<qs_parts.length;++i) {
 		 tmp = qs_parts[i].split('=');
 		 qs_params[tmp[0]] = tmp[1];
		 
			var so = new SWFObject("krpano.swf", "krpanoSWFObject", "100%", "100%", "9.0.28","#000000");
			so.addVariable("xml","angers.xml");
			so.addVariable('view.hlookat', qs_params['x']);
			so.addVariable('view.vlookat', qs_params['y']);
			so.addVariable('view.fov', qs_params['z']);
			if ( so.write("krpanoDIV") ) { var mousewheelfixes = new SWFkrpanoMouseWheel(so); }
}

		}
		else
		{
			document.getElementById("krpanoDIV").innerHTML = '<table width="100%" height="100%"><tr valign="middle"><td><center>ERROR:<br/><br/>Adobe Flash Player 9 needed<br/><br/><br/><a href="http://www.adobe.gigapixel/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>';
		}
		
	// ]]>

7

Freitag, 1. Oktober 2010, 08:31

Hi, try that:
if(qs_params['x']) so.addVariable('view.hlookat', qs_params['x']);
if(qs_params['y']) so.addVariable('view.vlookat', qs_params['y']);
if(qs_params['z']) so.addVariable('view.fov', qs_params['z']);

  • »jeromebg« ist der Autor dieses Themas

Beiträge: 1 120

Wohnort: Angers - France

Beruf: 360 experiences creator

  • Nachricht senden

8

Freitag, 1. Oktober 2010, 09:09

Perfect !
Thanx Klaus & srisa !!!

9

Freitag, 15. Oktober 2010, 08:30

Hi Guys,



I'm just landing here in this thread and loved the solution.

How can I implement here in my end, with an aditional that I have a tour with several panos (xml) and the link to facebook or twitter should get also the current xml url?

Jeromebg!! Congratulations!! Really nice work!!!!

Using that Javascript, how did you call it inside krpano xml??

Thanks,

Daniel

10

Samstag, 16. Oktober 2010, 19:47

Add another variable to the query string, like so, url=mypano.xml. Using the above mentioned javascript, you can access it as qs_params['url'].

Quellcode

1
so.addVariable('xml', qs_params['url']);

11

Sonntag, 17. Oktober 2010, 07:27

Sorry,

Just to understand it clearly....

I need to create a javascipt file (.js), make the html load it and on the xml button to facebook, what should I insert on the onclick="" field?

Thanks!!!

Daniel