need assign xml string structure to kpano player

  • Hello,
    is it possible to pass string with xml structure from javascript to embedpano like below sample :

    var myxml = "<krpano onstart=\"loaddefault()\" >";
    myxml += "<include url=\"panomaps.xml\" />";
    myxml += "<include url=\"navigationhide.xml\" />";
    myxml += " <include url=\"buttons-png-include.xml\" />";
    myxml += "<image>";
    myxml += "<sphere url=\"http://www.wowpassport.com/pano/mall.jpg\" />";
    myxml += "</image>";
    myxml += "</krpano>";

    embedpano({swf:"krpano.swf", id:"krpanoSWFObject", xml:"+myxml+", target:"krpanoDIV", width:"860", height:"420"});

    or isnt there any way instead of xml .

    thanks for your time
    best regards

  • Hi,

    that's not possible,

    but you can:
    1. pass 'null' for xml to avoid loading any xml file
    2. pass 'onstart' with 'js(krpanoready())' to make a callback to JS when the viewer is ready
    3. then add the JS function krpanoready() and there get the krpano viewer object
    4. call the 'loadxml' action and load your xml string

    e.g.

    Code
    <script>
    embedpano({swf:"krpano.swf", id:"krpanoSWFObject", xml:null, target:"krpanoDIV", width:"860", height:"420", vars:{onstart:"js(krpanoready())"}}); 
    
    
    function krpanoready()
    {
      var krpano = document.getElementById("krpanoSWFObject");
      krpano.call("loadxml(" + myxml + ")");
    }
    </script>

    best regards,
    Klaus

Jetzt mitmachen!

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