Javascript: Certain Image Names Break Hotspots (They Disappear)

  • I'm currently trying to generate hotspots on the fly with javascript. I have found that if I use short and simple names for my hotspots and my .GIF images, they work just fine.

    However, I would like to use GUIDs (Globally Unique IDentifiers) for the names because I have a database associated with them. The problem with this is that a hotspot will successfully get created and then disappear when another hotspot is created somewhere else down the line. There's no specific order two which hotspots cause others to get deleted and whenever this occurs, the newer hotspot has a distorted size.

    I wanted to just store the hotspot information in the XML file and modify it with javascript but it doesn't seem to work. If I use the krpano.set(hotspot[name].url=myurl.gif) action, the hotspot does not change from what I had in the XML. I need to be able to change this on-the-fly.

    The following code all seems to work just fine because the names are simple, I want to be able to use complex GUID names like d342d26b-92c0-4671-8ba3-bfa2df8603fe.gif.

    Thanks

    Here is my Javascript for creating hotspots :

    Here is my HTML page for the panorama:


    Here is my XML file for the Panorama:

  • Might help to just simply the request for support.

    Which filenames fail to load?

    No one's got time to build out a project with your code for testing. A better idea is to build it out and post a link online, then we can interface your project and trace out what's going on.
    You'll also need an onloaded attribute in your hotspot to call code to reset the size

  • Might help to just simply the request for support.

    Which filenames fail to load?

    No one's got time to build out a project with your code for testing. A better idea is to build it out and post a link online, then we can interface your project and trace out what's going on.
    You'll also need an onloaded attribute in your hotspot to call code to reset the size

    Hmm turns out I kind of solved my problem. I had made a function to convert numbers into strings so that my hotspot name would never have numbers in it; I just forgot to actually use the output of that as the hotspot name.

    So now the hotspots don't disappear - the problem seems to be that you can't have numbers in your hotspot name when using krpano.call(addhotspot(name)) .

    My work-around is functional but it's a bit strange that using numbers makes this behave so erratically.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!