Pass array object by js function

  • Hi

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

    I tried:
    js(proxy.sendArray(get(hotspot[poly].point)))
    And does not work :/

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

    Greetings

  • 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

    https://krpano.com/docu/plugininterface/#array

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

  • 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
    js(proxy.sendArray(hotspot[poly].point));
    js(proxy.sendArray(hotspot.getItem('poly').point.getArray()));
    </action>

    js
    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?

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!