You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Friday, June 16th 2017, 11:33am

Embedpano vars parameter bugged?

Hello, I have a problem. I need to pass some settings via embedpano vars parameter. I am passing object as said in documentation.
For example, this is not working:

Source code

1
settings["view.hlookat"] = 30; embedpano({xml:"pano.xml", target:"pano", vars:settings});


It is working if I pass:

Source code

1
settings["autorotate.enabled"] = true;



So where is the problem? Is it a bug, or documentation is wrong, or I am doing something wrong?

spacerywirtualne

Professional

Posts: 980

Location: Poland, Europe

Occupation: krpano developer : virtual tours

  • Send private message

2

Friday, June 16th 2017, 12:04pm

Welcome *smile*

Have you tried to do it as it is written in the documentation here ?


Best regards
Piotr
Your own online, cloud tool for creating virtual tours - www.cms4vr.com

facebook page :: youtube

cms4vr team *thumbsup*

3

Friday, June 16th 2017, 12:28pm

Yes, I am doing exactly as it is written in documentation. The issue is that some parameters are working, some not. If I pass autorotate.enabled, that parameter is registered, but if I pass view.hlookat or view.fov, they are not registered - nothing changes. If I set view.fov after krpano is loaded, it is working. But I need to override fov and other view parameters when embedding tour.

This post has been edited 1 times, last edit by "uzars" (Jun 16th 2017, 12:43pm)


spacerywirtualne

Professional

Posts: 980

Location: Poland, Europe

Occupation: krpano developer : virtual tours

  • Send private message

4

Friday, June 16th 2017, 1:38pm

Maybe krpano is not ready *question* *whistling*


Maybe this...

https://krpano.com/docu/html/#onready


Best regards
Piotr
Your own online, cloud tool for creating virtual tours - www.cms4vr.com

facebook page :: youtube

cms4vr team *thumbsup*

5

Friday, June 16th 2017, 2:03pm

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<script>
function handleReady (krpano) {
  krpano.set("autorotate.enabled", true); // working only if not defined in params
  krpano.set("view.hlookat", 60); // not working
  setTimeout(function () {
    krpano.set("view.hlookat", 60); // working
  }, 1000);
}

var params = {};
params["autorotate.enabled"] = false; // working
params["view.hlookat"] = 60; // not working

embedpano({swf:"tour.swf", xml:"tour.xml", target:"pano", html5:"auto", mobilescale:1.0, passQueryParameters:true, vars: params, onready: handleReady});
</script>


I feel like this is unexpected behavior. Meaning - either documentation is unclear/wrong, or - there is a bug in krpano. *sad*

6

Monday, June 19th 2017, 9:55am

Hi,

note - default tours start with a 'loadscene' call - and with that the view settings from the given scene are loaded.

The 'vars' settings itself are passed before that and so don't have an effect in this case.

You could extend the first loadscene call with a KEEPVIEW flag, then the passed view will be used/kept.

E.g. look in the tour.xml for this line:

Source code

1
loadscene(get(startscene), null, MERGE);

and change it to:

Source code

1
loadscene(get(startscene), null, MERGE|KEEPVIEW);


Best regards,
Klaus

7

Tuesday, June 20th 2017, 10:28am

Oh, this makes sense. Thanks. Maybe adding a note to documentation about this is a good idea to prevent confusion. This line is the confusing one:

Source code

1
settings["view.hlookat"] = 30;

Expected that to work right away... without knowledge about KEEPVIEW it is hard to make sense of it.