set hlookat from (external) javascript

  • It's been a long time since I worked in krpano and I have a problem:
    I need to orient a 360 to the magnetic north.
    I have a script in the parent page e.g.:
    function myLocation(){
    console.log('test')
    return '30' //deviation from the magnetic north - dummie value
    }

    If I run this function from my hlookat, it returns/logs nothing
    (<view hlookat="js(myLocation())" ...)

    I can run it from <scene onstartup="js(myLocation())"
    That actually runs the console.log.

    I also tried it this way, but to no result:
    <script>
    embedpano(
    {
    xml:"tour.xml",
    target:"pano",
    onready:function(krpano) {
    krpano = krpano.get("global");
    krpano.set("view.hlookat", 30);
    }
    }
    );
    </script>


    So, long story short: how do I pass a value to hlookat from the parent-page?

    thanks

    Edited once, last by kvd (November 28, 2023 at 1:37 PM).

Participate now!

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