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*

  • Thanks to Klauss.

    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.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!