Page 1 of 1

Trying to understand API

Posted: Wed May 12, 2010 3:17 am
by panocanarias
I'm trying to understand and use the JavaScript-API .
What I want to do is: loading a new pano by clicking on a link (text or image).
I had a look at the documentation (http://tinyurl.com/3xrqd56) and the linked example.
Unfortunately the example does not demonstrate a "openNext" action.
Documentation says:

Code: Select all

pano.openNext(<url:String>,<parameter:String>); // Open next panorama
I'm trying this:

Code: Select all

<a onClick="pano.openNext(pano5_out.swf);" href="#">Load Pano 5</a>
But nothing happens.
A pano.moveTo(....) link works like expected.
I uploaded a simple testpage (http://tinyurl.com/35z9lj5) so one can check the sourcecode (will remove it in a few days).
What am I doing wrong?
What does <parameter:String> mean? Which parameters can/should I use here?
Somebody please could give me a hint or advice? Any example to view?

Thanks, Klaus

Re: Trying to understand API

Posted: Wed May 12, 2010 6:29 pm
by panocanarias
Update

Well, I think after a lot of trial 'n error I got finally it.
It seems, it's a question of syntax.
You have to wrap the <Url:String> in single quotes (= ' xxx.swf '). Documentation is a bit unclear here.
Should look like this example:

Code: Select all

<a onClick="pano.openNext('pano5_out.swf');" href="#">Load Pano 5</a>
But still I do not know what <parameter:String> means or is good for. Thomas ?

I updated my testpage (http://tinyurl.com/35z9lj5). Should work now.
( Comments appreciated )

Salu2, Klaus

Re: Trying to understand API

Posted: Wed May 12, 2010 6:59 pm
by thomas
panocanarias wrote:But still I do not know what <parameter:String> means or is good for. Thomas ?
The parameters are same as the "target" field in the GUI so you can change the starting position of your next panorama.

Re: Trying to understand API

Posted: Wed May 12, 2010 11:06 pm
by 360Texas
I clicked your tiny URL... got a white page.. lower left corner says "Done".

I am using IE 8

Re: Trying to understand API

Posted: Thu May 13, 2010 12:23 am
by panocanarias
Dave, could you try the direct link, please.
I don't have any problem here with Firefox (XP).
http://www.panocanarias.com/testzone/pano1.html
Thanks for testing ...
Salu2, Klaus

Re: Trying to understand API

Posted: Thu May 13, 2010 10:18 am
by Hopki
I am also getting the blank page, IE 7, windows EX. Used the new direct link.
Cheers Hopki

Re: Trying to understand API

Posted: Thu May 13, 2010 4:35 pm
by 360Texas
Yes, that last link works fine. Grid sphere, 1 and 5 buttons work great

Re: Trying to understand API

Posted: Thu May 13, 2010 5:02 pm
by Hopki
Working now for me too.
Out of interest, I made this a while back Link
all the best hopki

Re: Trying to understand API

Posted: Thu May 13, 2010 5:07 pm
by panocanarias
@Dave, @Hopki

Thank you both for testing !
Thanks for the link, Hopki. Will have a closer look.

Well, now I can go ahead...
.. trying to use a scrolling thumbnail-menu (Flash or Jquery driven) to trigger a "load pano action" ....
Surely that's nothing new and has been done before.
Anybody can point me to working examples ?

Salu2, Klaus

Re: Trying to understand API

Posted: Sat May 15, 2010 2:27 pm
by smithdwsn
I have faced same problem when i am clicking on this tiny url. There is no contents will display. Done the message. I am using Internet Explore 8. So any problem with my IE.

Re: Trying to understand API

Posted: Sat May 15, 2010 3:22 pm
by panocanarias
.. have faced same problem when i am clicking on this tiny url.
Very strange....
The page was automatically generated by P2VR (flash/html output).
There should be the pano window, loading initial pano.
No Javascript-Flash interacting (API) at this stage.
The only difference to 'normal' output is the slight change in p2q_embed_object.js, allowing 'externalinterface',
generated automatically, too. (See documentation: http://gardengnomesoftware.com/wiki/Pan ... Script_API).
Could this be a Tinyurl problem? What happens, when ckicking direct link ?
Can't reproduce this error.

Stumped, :?
Klaus