Sie sind nicht angemeldet.

1

Mittwoch, 1. Juli 2015, 15:15

open different panorama according the time (day/night) or certain month/season

Hi all,
Recently I have a hotel client, where I shot the panoramas in the winter and now in summer too.
I want to achieve this: when opening the Virtual Tour from the hotel website, the winter panorama will be opened in the winter time and summer in the summer. Or similarly with the night/day.
The same with the hotspots - let´s say we are in the hotel room and click on the balcony hotspot - if it is winter, the winter panorama would open etc...
How to achieve that? I did not find any internal krpano action which could help me with that, so I assume I will need to do this in javascript?
Thank you in advance!
Best regards,
Igor Socha

2

Freitag, 3. Juli 2015, 20:42

Hi,

Yes you would have to use javascript, and pass a variable to Krpano depending on the current date to tell it to load the desired panoramas. It wouldn't be too hard to achieve.

Best regards,
Hernán
My Krpano plugins: Auto Thumbs - Tooltip - Abs

3

Freitag, 17. Juli 2015, 12:48

I believed this code by Zephyr could help, but somehow it returns some error:

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
<krpano>
   <events onxmlcomplete="parsedate()" />
   <action name="parsedate">
          js(get_date());
          if(get(day) == '24',
               if(get(month) == '02',
                  if(get(year) == '2011',  
                      trace('Jeej, today is 24-02-2011');
                  );
               );
          );
    </action>
</krpano>


html:

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
function get_date()
{
	var krpanoObj = document.getElementById('krpanoSWFObject');
	
	var date = new Date();
	var d  = date.getDate();
	var day = (d < 10) ? '0' + d : d;
	var m = date.getMonth() + 1;
	var month = (m < 10) ? '0' + m : m;
	var yy = date.getYear();
	var year = (yy < 1000) ? yy + 1900 : yy;
	
	krpanoObj.set('day', day);
	krpanoObj.set('month', month);
	krpanoObj.set('year', year);
}


Sorry Im a bit rusty with xml if statements, so mind the typos. But you get the idea :)


Here is the original post: http://krpano.com/forum/wbb/index.php?pa…24185#post24185

I wanted to alter this code for my purposes, but first I wanted to try how it works. ANd this is what I get:

Warning: js() - calling Javascript "get date()" failed: Error: TypeError: krpano.set is not a function

Any help? Are there any typos?
Best regards,
Igor Socha

4

Freitag, 17. Juli 2015, 16:21

OK, I had a luck and found where was the problem:

Zitat

Flashplayer Notes: This function requires the External Interface of the Flashplayer! This means the call-back will work offline/locally only when the security settings of the Flashplayer were adjusted. See here for more detatils - Local / Offline Usage.

http://krpano.com/docu/html/#onready Seems that the same applies also to my problem (I was testing on the desktop with flash player)
Best regards,
Igor Socha