Hi all/Klaus,
When embedding krpano and using the onready callback, I get the krpano Javascript Interface returned. https://krpano.com/docu/js/#interfaceobject
It contains 5 methods (get, set, call, spheretoscreen and screentosphere)
If I want to add a hotspot, I need to do something like this:
krpano.call('addhotspot(test)');
krpano.set('hotspot[test].ath', 0);
// or krpano.get('hotspot[test]').atv = 0
When I approach it via the plugin interface way:
<action name="test" type="Javascript" autorun="onstart">
<![CDATA[
window.krpano = krpano
// or onReay(krpano)
]]>
</action>
I get a lot more tooling to my dispossal. Adding a hotspot would be
var hs = window.krpano.addhotspot(name)
hs.ath = 0
I was wondering what is the difference?
My usecase: I want to create a tour manager, which loads in hotspots from a json api, and places them in krpano and can control other things of krpano also. Krpano needs to be as simple as possible and just focus on presenting the panoramas and leave the behaviours to the javascript layer. It also allows me to write React and use Es6 and let it bundle by webpack.
Thats why I thought going the javascript interface way is the best way forward. But then I saw that for example addhotspot is not available via the onready, but it is via an action.
What would be your opinion.