Get array of every hotspot via Javascript

  • Hi,

    I am trying to get an array of every hotspot that is present in a tour regardless of which scene it belongs to. So for example krpano.get("scene") will give me an array of every scene but need an equivalent for hotspots.

    I would also like to establish the parent scene of each hotspot.

    Any suggestions as to the best way forward?

    Thanks
    GK

  • GeoK,

    As you can see the post, the hotspots are generated on-the-fly when scene is created. (Pro: same hotspotnames for different scenes, loading Just In Time).

    Apparently I will face to the same issue and I see following scenarios:
    a) create my own xml tag with hotspot attributes and scenename and load the particular hotspots on the onstart event of the scene;

    b) create all hotspots outside the <scene /> tag and add the attribute scenename=parent_scene to each hotspot. On onstart event of the scene just set enabled=true for the hostposts where the scenename=currentscene.
    (Cons: performance and memory issue when big image hotspots).

    Has anybody a better idea?
    Thank all of you,
    Pavel

  • you need to understand that :
    - you can access all scene properties by scene[x].property
    - but there is only one scene content active at a time

    that means you cannot access the hotspots defined in any scene,
    only the ones of the active loaded scene.

    so either you parse all scenes xml manually by using scene[x].content
    or you build your hotspot information as an array outside the scenes,
    and then add them dynamically onxmlcomplete or onnewscene for each scene

  • I suppose by way of a feature request - it would be useful to have access to the full XML. Parsing the xml text is fine albeit a bit clumsy and I would hazard a guess that eventually, parsing may fail due to future version changes in the xml - naming conventions, syntax changes, etc....?

Jetzt mitmachen!

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