Forums  

Go Back   Forums > Talk > General FPP Discussion

Reply
 
Thread Tools Display Modes
  #1  
Old 02-23-2011, 06:50 AM
JaRo JaRo is offline
Junior Member
 
Join Date: Sep 2009
Location: Głog?w
Posts: 22
Downloads: 0
Uploads: 0
Default $_GET && coordinates

Hi, is this possible to click on the panorama swf and get actual coordinates by GET method?

For example: example.com/?pan=20&tilt=-22

Cheers
Reply With Quote
  #2  
Old 02-23-2011, 07:20 AM
Trausti Hraunfjord's Avatar
Trausti Hraunfjord Trausti Hraunfjord is offline
Administrator
 
Join Date: Dec 2007
Location: Icelander in Peru(dise)
Posts: 1,563
Downloads: 1
Uploads: 0
Send a message via Skype™ to Trausti Hraunfjord
Default

Nope, but Tommy's coordinates plugin will do the job properly:

http://wirestam.com/panos/Flash/plug...ordinates.html
__________________
Trausti Hraunfjord
Flashificator, the GUI for FPP.
Win-Mac compatible.
Reply With Quote
  #3  
Old 03-03-2011, 11:57 AM
davide73 davide73 is offline
Junior Member
 
Join Date: Dec 2010
Posts: 6
Downloads: 3
Uploads: 0
Default

hi, I'm not sure I've understood your request but I use a javascript function, binded to a button, that alerts a string with all current parameters, formatted as a proper url in a GET fashion. Having set up the main html to parse the url, getting the parameters and loading the proper pano with the desidered parameters, the result is this:

a user finds a spot of interest and pressing a button a proper url is provided: this url links directly to the particular detail and can be pasted into mails, pages etc.

functions:
getPanoUrl: asks parameters to the flash object and forms the url

Code:
function getPanoUrl(){

panoUrl=window.location.href.split("?",1)

panoUrl+="?startpano="+window.document.pano.myidPanoGet('pano.panoname')

panoUrl+="&pan="+window.document.pano.myidPanoGet('pano.pan')

panoUrl+="&tilt="+window.document.pano.myidPanoGet('pano.tilt')

panoUrl+="&zoom="+window.document.pano.myidPanoGet('pano.zoom')

panoUrl+="&disAutorot=1"

alert("copy this link:\n"+panoUrl) 

}

getParm: parses the url and get the parameters. Please note that this could be actually improved parsing all parameters once, i.e. converting the GET in an array... todo!

Code:
function getParm( name ){
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null ) //here default values if no parameters are found in the url
    switch (name){
      case "startpano":
	return "hereDefaultPanoName";
	break;
      case "pan":
	return 0;
	break;
      case "tilt":
	return 15;
	break;
      case "zoom":
	return 0.7;
	break;
      case "disAutorot":
	return 0;
	break;
    }
    else
    return results[1];
}

the main script to load the flash with the proper parameters decoded from the url:

Code:
<script type="text/javascript">

	  var startPano = getParm("startpano");

	  var pan = getParm("pan");

	  var tilt = getParm("tilt");

	  var zoom = getParm("zoom");

	  var autorot = getParm("autorot");

	  var so = new SWFObject("pano.swf", "pano", "100%", "550", "9", "#282828"); 

	  so.addVariable("pan",pan);

	  so.addVariable("panoName",startPano);

	  so.addVariable("tilt",tilt);

	  so.addVariable("zoom",zoom);

	  so.addVariable("xml_file","main.xml");

	  so.addParam("allowFullScreen","true");

	  so.addParam("allowScriptAccess","sameDomain");

	  so.addParam("global.onStart","go_05");

	  so.write("flashcontent");

	  window.document["pano"].focus();    

</script>
please note also that in this way is possible to have a single main html that loads any pano.

hope this could help,
bye
Reply With Quote
  #4  
Old 04-22-2011, 01:15 PM
JaRo JaRo is offline
Junior Member
 
Join Date: Sep 2009
Location: Głog?w
Posts: 22
Downloads: 0
Uploads: 0
Default

Thanks dude! I just noticed your reply. Many thanks.
Reply With Quote
  #5  
Old 04-22-2011, 01:40 PM
kbellis's Avatar
kbellis kbellis is offline
Senior Member
 
Join Date: Aug 2010
Location: Ellsworth, ME
Posts: 106
Downloads: 0
Uploads: 0
Default

Hi Dave,

Do you have an example posted to see this in action?

Thanks.

Kelly
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 06:37 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.