You are not logged in.


Tuesday, October 22nd 2019, 4:52pm

Pass array object by js function


is it possible pass array (points of polygonal hotspot) by js function?

I tried:
And does not work :/

Do you have any idea, how to recieve array in sendarray method in js file.



Tuesday, October 22nd 2019, 5:08pm

1) get() maybe wont work like this, i guess it should be krpano.get()
2) hotspot[poly].point is probably a krpano array not a native js array, so you might need hotspot[poly].point.getArray()
3) dont forget: js() takes a js call, you cant work there like in krpano xml scripting

untested, but i would try:
js( "proxy.sendArray(krpano.hotspot.getItem('poly').point.getArray());" );


Wednesday, October 23rd 2019, 9:40am

Thank you for help it works!! but the solution is not what I wanted. I would like to pass array points to js method from krpano actions like this:

<action name="testAction">
// get(hotspot[poly].point) -> in krpano xml actions I got [object object] and possible to iterate

function sendArray(array) {
array // null or hotspot[poly].point as string or [object object] as string but i expect array object here :)

is It even possible?