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:

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

    It is working if I pass:

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




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

  • 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.

    Einmal editiert, zuletzt von uzars (16. Juni 2017 um 12:43)

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

  • 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:

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


    and change it to:

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

    Best regards,
    Klaus

  • 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:

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


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

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!