Hello there.
I am trying to add a hotspot into a layer. So far no success.
I'm using the next script to add my hotspots:
var h = krpano.get("view.hlookat");
var v = krpano.get("view.vlookat");
var hs_name = "hs" + ((Date.now() + Math.random()) | 0); // create unique/randome name
krpano.call("addhotspot(" + hs_name + ")");
krpano.set("hotspot["+hs_name+"].url", "hotspot.png");
krpano.set("hotspot["+hs_name+"].scale", 1);
krpano.set("hotspot["+hs_name+"].ath", h);
krpano.set("hotspot["+hs_name+"].atv", v);
krpano.set("hotspot["+hs_name+"].ondown", "draghotspot();");
krpano.set("hotspot["+hs_name+"].distorted", false);
This script is a Javascript inside an xml file. But it seems to add the hotspot into a higher level layer.
I already tried using:
<hotspot name="spot1" url="hotspot.png" scale="1" ath="0" atv="0" keep="true" parent="Hotspots_layer" ondown="draghotspot();" />
But it only works if I use keep="true"(otherwise hotspots is not visible) and also it doesn't respect the layer where hotspot is inside.
Thanks for the help.
Regards.
Jovan.