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.

ciul

Trainee

  • "ciul" started this thread

Posts: 149

Location: Colombia

Occupation: Creative developer guy

  • Send private message

1

Tuesday, December 14th 2010, 2:39am

screentosphere not working on Safari but working on Mozilla



Above is a printscreen image where you can see both javascript consoles from Safari and FireFox.

Following the examples from Krpano files I was using this way to retrieve mouse position with a method:

...

getMousePosition: function() {
var mousex = this.get('mouse.x');
var mousey = this.get('mouse.y');
var hvs = this.get('screentosphere(' + mousex + ',' + mousey + ')');
var hva = hvs.split(',');
var ath = Number.from(hva[0]);
var atv = Number.from(hva[1]);
var mouseposition = {
x: mousex,
y: mousey,
ath: ath,
atv: atv
};
return mouseposition;
},
...

As you can see in the image, at FireFox hvs returns the corresponding value (-53.13, -30.96) but at Safari it returns null.

Any help with that? *confused*

ciul

Trainee

  • "ciul" started this thread

Posts: 149

Location: Colombia

Occupation: Creative developer guy

  • Send private message

2

Tuesday, December 14th 2010, 11:49am

Solved

Thanks to Klauss.

Quoted

Hi,
with "Safari" you mean the krpanoJS viewer, or?

sorry, but there this kind of functionally (get -> function) is
not supported, there only the normal actions can be used,

please have a look at the updated krpano examples,
e.g. here:

http://krpano.com/examples/10812/example…se/jsmouse.html

it shows how to do that in a way that is compatible
with the krpano Flash and the krpano Javascript viewer,

best regards,
Klaus


So the method changed to something like this:


getMousePosition: function() {
this.call('screentosphere(mouse.x, mouse.y, mouseath, mouseatv)');
var mouseposition = {
x: this.get('mouse.x'),
y: this.get('mouse.y'),
ath: this.get('mouseath'),
atv: this.get('mouseatv')
};
return mouseposition;
},

and now it is working *thumbsup*

Thanks again Klauss.