Trying to understand API

Q&A about the latest versions
Post Reply
panocanarias
Posts: 28
Joined: Sat Sep 09, 2006 7:28 pm
Location: Tenerife, Canary Islands, Spain

Trying to understand API

Post by panocanarias » Wed May 12, 2010 3:17 am

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

panocanarias
Posts: 28
Joined: Sat Sep 09, 2006 7:28 pm
Location: Tenerife, Canary Islands, Spain

Re: Trying to understand API

Post by panocanarias » Wed May 12, 2010 6:29 pm

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

User avatar
thomas
Chief Gnome
Posts: 2524
Joined: Fri Sep 01, 2006 3:56 pm
Location: Vienna, Austria
Contact:

Re: Trying to understand API

Post by thomas » Wed May 12, 2010 6:59 pm

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.
MfG, Thomas

User avatar
360Texas
Moderator
Posts: 3343
Joined: Sat Sep 09, 2006 6:06 pm
Location: Fort Worth, Texas USA
Contact:

Re: Trying to understand API

Post by 360Texas » Wed May 12, 2010 11:06 pm

I clicked your tiny URL... got a white page.. lower left corner says "Done".

I am using IE 8
Dave
Pano2VR Forum Global Moderator
Image
Visit 360texas.com

panocanarias
Posts: 28
Joined: Sat Sep 09, 2006 7:28 pm
Location: Tenerife, Canary Islands, Spain

Re: Trying to understand API

Post by panocanarias » Thu May 13, 2010 12:23 am

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

User avatar
Hopki
Gnome
Posts: 9447
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Re: Trying to understand API

Post by Hopki » Thu May 13, 2010 10:18 am

I am also getting the blank page, IE 7, windows EX. Used the new direct link.
Cheers Hopki

User avatar
360Texas
Moderator
Posts: 3343
Joined: Sat Sep 09, 2006 6:06 pm
Location: Fort Worth, Texas USA
Contact:

Re: Trying to understand API

Post by 360Texas » Thu May 13, 2010 4:35 pm

Yes, that last link works fine. Grid sphere, 1 and 5 buttons work great
Dave
Pano2VR Forum Global Moderator
Image
Visit 360texas.com

User avatar
Hopki
Gnome
Posts: 9447
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Re: Trying to understand API

Post by Hopki » Thu May 13, 2010 5:02 pm

Working now for me too.
Out of interest, I made this a while back Link
all the best hopki

panocanarias
Posts: 28
Joined: Sat Sep 09, 2006 7:28 pm
Location: Tenerife, Canary Islands, Spain

Re: Trying to understand API

Post by panocanarias » Thu May 13, 2010 5:07 pm

@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

smithdwsn
Posts: 3
Joined: Thu May 13, 2010 7:28 pm

Re: Trying to understand API

Post by smithdwsn » Sat May 15, 2010 2:27 pm

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.

panocanarias
Posts: 28
Joined: Sat Sep 09, 2006 7:28 pm
Location: Tenerife, Canary Islands, Spain

Re: Trying to understand API

Post by panocanarias » Sat May 15, 2010 3:22 pm

.. 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

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 29 guests