You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

wtservizi

Trainee

  • "wtservizi" started this thread

Posts: 44

Location: ITALY

Occupation: Photographer

  • Send private message

1

Wednesday, March 3rd 2010, 9:53am

loadxml is producing a white screen flash

I need to load panoramas with a set of dinamically generated hotspots, so i am using laodxml to load the generated xml hotspots string.

I am using krpano 1.0.8 beta8 with following sequnce of operation:

1) load a skin xml containing no image but only buttons etc.
2) load hotspots string with loadxml
3) load panorama xml with loadpano



Each hotspot has its onklick action set to call a javascript function that perform step 2) and 3) using the new pano connected to the clicked hotspot.

It works but there is an orrible effect of white flashing screen when loadxml is performed and the blend effect set with loadpano is not performed.

I tested the same code using html buttons to simulate hotspot clik and removing the loadxml step. Everything performs well, no flashes and blend effect is performed properly when loading the new pano.



Any idea how to avoid the white screen flash?

Thanks M

wtservizi

Trainee

  • "wtservizi" started this thread

Posts: 44

Location: ITALY

Occupation: Photographer

  • Send private message

2

Wednesday, March 3rd 2010, 11:39pm

How is laodxml working?

Possibly I have misunderstood the meaning of loadxml. Can anyone clear it to me?



I have just realized that calling loadxml clears the currently loaded panorama.

In effect if I load a panorama with loadpano and after I call loadxml with a string containing only hotspots, the pano is cleared and my scene is blank with only the hotspot loaded.



Any way to load a pano and after to load only hotspots without clearing the pano?



Thanks

3

Friday, March 5th 2010, 7:44am

Hello,

If I understand you correctly, you've loaded a pano, and then you would like to load a set of hotspots on that already loaded pano. These hotspots are dynamically generated into another xml file.

If you don't mind reloading your existing pano, you can put an include statement in the xml for your pano which will load the dynamically generated hotspots each time you reload the panorama.

I did a little work in javascript using XMLHttpRequest where I could read an xmlfile, traverse the DOM tree and create the krpano actions to implement the hotspots from the xmlfile. It worked great until I tried to embed it in a krpano panorama and then the XMLHttpRequest stopped working! Perhaps one of our local Ajax experts can figure out how to get this to work, I was trying to use the Microsoft.XMLDOM ActiveXObject (or document.implementation.createDocument for non-IE browsers) to parse the XMLfile and create a traversable data structure.

How are you dynamically generating the hotspot xml file? Can you instead generate a javascript file which contains the commands to create the hotspots? If so, you could dynamically load the javascript file from within krpano to generate your hotspots.

steve

wtservizi

Trainee

  • "wtservizi" started this thread

Posts: 44

Location: ITALY

Occupation: Photographer

  • Send private message

4

Friday, March 5th 2010, 11:25am

Tanks Pinsane,



My hotspots are stored in a database and my original approach was to extract hotspots from db and generate a xml containing all the hotspots, to be loaded with a single call to loadxml from javascript.



Due to the problem with laodxml call described in the previous posts I changed my approach to:

- in my codebehind at pageload extract from the db all the hotspots of the virtual tour

- pass all the hotspots in hiddenfields to the HTML, tagging eachone with the panorama of the virtualtour it is associated

- use a javascript in HTML to get the hotspots associated to the loaded panorama and I load them, one at the time, with addhotspot calls



It works smoothly



M

Similar threads