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?
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,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
you can use keep=true and then remove them manually if you dont need them anymore
an alternative is to write xml into the scene content, see this thread
https://krpano.com/forum/wbb/inde…&threadID=17834
you can use keep=true and then remove them manually if you dont need them anymorean alternative is to write xml into the scene content, see this thread
https://krpano.com/forum/wbb/index.php?p…&threadID=17834
hi
Do you mean to set keep = true when loading hotspots in a scene, and then delete all hotspots before loading hotspots in the current scene when switching to the next scene?
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.
For your case you could add a callback e.g. this way:
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
Display MoreHi,
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.
For your case you could add a callback e.g. this way:
Codekrpano.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.
Best regards,
Bill
Don’t have an account yet? Register yourself now and be a part of our community!