Why does adding "hotspot" immediately after executing the "loadscene" method fail to render?

  • When I execute the "loadscene" method and add a "hotspot", it will not be displayed



    When I add "hotspot" asynchronously

    It shows up



    Is this caused by over animation of 2 seconds?

    and,"setTimeout",Is this delay loading correct?



  • hi,

    probably yes, after the 2 seconds your hotspot gets unloaded, because you are not setting keep=true

    best, index

    Hi,

    Thank you for your reply,

    I use code to control the dynamic loading of scenarios and hotspots. The hotspots of each scenario are different, so keep = true cannot be set. Is this problem unavoidable when loading dynamically?

    best

  • Hi,

    the loadpano/loadscene calls are 'async'.

    To make sure something happens when they are done, the related code should be defined after the loadpano/loadscene in the same call.

    e.g.

    Code
    loadscene(...); trace('now the scene is loaded');

    For your case you could add a callback e.g. this way:

    Code
    krpano.set("callback", function(){ ... your JS code ...});
    krpano.call("loadscene(...); callback();");

    This way the correct order is ensured and hotspots added in the JS code will be related to the new scene.

    To make such usage easier, I will add a possibility to add a JS callback directly in the loadpano/loadscene calls in the next releases.

    Best regards,
    Klaus

  • Hi,

    Thank you very much for your reply.

    Your reply made me suddenly clear. *thumbup*

    Best regards,

    Bill

Participate now!

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