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.

lrwieland

Beginner

  • "lrwieland" started this thread

Posts: 25

Location: Austin, TX USA

Occupation: Officially retired, but really a full time panographer

  • Send private message

1

Thursday, April 17th 2014, 7:22pm

onnewpano and onnewscene events not fired in 1.17

I mentioned earlier in my post on spheretoscreen not working on the iPhone that 1.17 broke my application, and I now know why. In 1.17, at least on my system with my scripts, neither the onnewpanorama and onnewscene events are getting fired at all. Also krpano is not reporting any errors. The lack of these events caused my html5 only application to break from 1.16.5, since I am listening for and depending on these events. I am seeing the onxmlcomplete event but that seems to be the only one that is getting fired in the load sequence.

Environment: krpano 1.17, up-to-date Chrome, up-to-date OS X Mavericks.

Unfortunately my environment is quite complex and is only running on localhost for now. I have attached two scripts, startup.xml, and SouthKaibab.trl_Trailhead.pan.xml which is representative xml for one of the hundreds of panoramas that the application can load. No panorama is loaded from startup.xml. The action loadNewNode in startup.xml is called from javascript when my app loads new panoramas. Again all of this worked perfectly on 1.16.5.

Not Cheers,
Larry Wieland
lrwieland has attached the following files:

2

Friday, April 18th 2014, 1:48pm

Hi,

sorry, but I don't see any reason why these events shouldn't work...
Have you tried adding trace calls inside the krpano actions to test if they are working?
Are there any Javascript errors?
Maybe there is some kind of timing problem where things were tried to be accessed which aren't there at that time...

Best regards,
Klaus

lrwieland

Beginner

  • "lrwieland" started this thread

Posts: 25

Location: Austin, TX USA

Occupation: Officially retired, but really a full time panographer

  • Send private message

3

Saturday, April 19th 2014, 1:23pm

Hi Klaus,

I am as puzzled by this as you. There are not Javascript errors. there are no krpano errors. I have tried both trace statements in the action scripts and callbacks to javascript to post simple messages in event handlers and get nothing except for the xmlcomplete event. All I can say with certainty at this point is that my app broke when I made the change in my html page to point to 1.17 instead of 1.16.5 and nothing more. I realize that without a page to look at you really have nothing to respond to. Unfortunately I'm currently on the road and won't get back to my development environment until Tuesday In the US, but when I do I'll resume testing and if necessary post a simple page with a URL you can access and we can discuss, so you probably will not see anything until Wednesday your time.

Cheers,
Larry Wieland

lrwieland

Beginner

  • "lrwieland" started this thread

Posts: 25

Location: Austin, TX USA

Occupation: Officially retired, but really a full time panographer

  • Send private message

4

Monday, April 21st 2014, 11:48pm

Well I've decided to sign off on this thread for now. With the spheretoscreen issue resolved I don't have any compelling need to move to 1.17 now and multiresolution now, but I expect I'll give it another shot in time. When I do and if I'm still having trouble I'll pick up this thread.

Cheers,
Larry Wieland

5

Wednesday, April 30th 2014, 3:13pm

I confirm that onnewscene is not working for me too. I need to register JS functions and scene changes (through hotspots) and I don't know how to do it without that event *sad*

6

Wednesday, April 30th 2014, 3:38pm

Hi,

which krpano version?
Flash or HTML5?

Do you have an example or a link to an example?

Best regards,
Klaus

7

Tuesday, May 6th 2014, 11:37am

I'm sorry, I didn't receive the notification.
krpano version is 1.17.pr2 (build 2014-01-10).

Source code

1
<events onnewscene="js( grabnewscene() );"/>



grabnewscene is a global variable function. It grabs other events (e,g, onviewchange) but onnewscene never is emitted.

8

Tuesday, May 6th 2014, 11:42am

Hi,

the onnewscene event was added in the final 1.17 release - see here the news at 'krpano XML Interface':
http://krpano.com/news/#releasenotes117

So it's impossible that it will work on the pre release version!

Best regards,
Klaus

9

Tuesday, May 6th 2014, 11:45am

Thanks. I will upgrade asap

lrwieland

Beginner

  • "lrwieland" started this thread

Posts: 25

Location: Austin, TX USA

Occupation: Officially retired, but really a full time panographer

  • Send private message

10

Wednesday, May 28th 2014, 6:51pm

Well, Klaus, we were both right. Your event behavior has changed with version 1.17. In earlier versions, the onnewpano and onnewscene events were fired when loadpano action was called to load an xml file that only contained <scene> elements. In version 1.17, in my testing, these events get fired only after a loadscene action is called.


I have hundreds of panorama node locations in my application, and I have a separate xml file for each location, and each location xml file has one or more <scene> elements within it. When the user of my application moves to a new location, I call loadpano to load the xml file for that location, and I was waiting for the onnewpano event to be fired after calling loadpano to call loadscene to display the first scene at the location (but since it never came in 1.17 I never made the necessary loadscene call). For 1.17 I am now instead listening for the onxmlcomplete event following the loadpano before making the initial loadscene call.



I had been listening for onnewpano instead of onxmlcomplete as a precaution against race conditions. It does seem to be working in 1.17 to use the onxmlcomplete event, but do I have any risk of race conditions in doing so, and if so which event should I be listening for to mark the completion of the loadpano processing before calling loadscene?


I actually think that the new event structure is better, but some additional detailed documentation of exactly which events get fired in what order following which actions would be helpful.


Cheers,
Larry Wieland