How to create a Back Button with previous VIEW

Q&A about the latest versions
Post Reply
Arnie
Posts: 33
Joined: Wed May 28, 2008 4:27 pm

What I try to achieve is a back button placed in a static position of the skin (top right corner) with the mouse click action to go back to the last visited node.
This is pretty easy in itself:
Action:
Source: Mouse Click
Action: Open Next Panorama
URL:Last Visited Node (I really like this new function!!!!!!)
View: Default View

But what I want i not only to go back to the last visited node, I also want to go back to the same View in the last node.

I can use a hotspot - make it look like a back Button using a text field placed over the hotspot using the Action:
Source: Mouse Click
Action: Open Next Panorama
URL: Hotspot URL
View: Target View - this view can be defined when adding a hotspot to a node (Hotspot properties - Target and click on the red/white circle.

This way I get my back button that brings me back to the overview node and zoomed in to the correct position, but a hotspot is anchored to the node not to the skin and even if I place the hotspot in the top right corner it will move out of the view when zoom in.

Here is a link to a test setup: http://mediapix.com.au/vt/backbuttontest/ - the hotspot is behind you (red circle).

The perfect solution would be if the tour would not only remember the last visited node, but also remember the view of the last node.

I tired to get this done using variables.
I created the variables: pan, tilt, fov and was hoping I could use the action of a hotspot to populate the current view when clicking the hotspot by using set variable values but I didn't get it working


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

Hi Arnie,
Please see this post: viewtopic.php?f=6&t=11616&p=47924&hilit=#p47924
Regards,
Hopki
Garden Gnome Support
If you send an e-mail to support please send a link to the forum post for reference.
support@ggnome.com
https://ggnome.com/wiki/documentation/
Arnie
Posts: 33
Joined: Wed May 28, 2008 4:27 pm

Hi Hoki
Thank you for your respond but I think you send me the wrong link.
I don't need a next/previous button with thumbnail, I need a back button with the following functions:
- static on the skin (not anchored on set position in the image/pano
- back to last visited node ( {back} ) with the same view direction and zoom level it was when leaving the node ($cur is not working as this would apply the current view to the "back node".

Scenario:
I am viewing a pano or flat image and I zoom in and navigate (pan/tilt) to a hotspot. With a click I get to a high resolution flat image. The skin provides a back button placed in set position on the screen (top/right), not effected by any zoom/ left/right and up/down movement (inspection the high resolution image).
With a click on the back button I want to return to the last visited node and find myself in the same position as I left this node.

The {back} function returns you to the last visited node but so that is solved, but I cannot find a solution for the View (pan/tilt/fov value according to where I was in the last visited node).
I tried to solve this problem by using variables:
I created the variables: pan,tilt and fov. I added the action function: set variable value to the hotspot template for each variable:
Image

Next I tried to apply the variables values for pan, tilt and fov that should now have the information of the view at the time when clicking the hotspot, to the View in the action settings for the back button but I cannot find a placeholder for variables to enter in the fields.
It would need the option to use the variables like you can do when using logic blocks where the variables appear in the drop-down menu for the trigger.
Image

So ideally I should be able to do this:
Image

Do you think this is possible, do I miss something? Or do you have another approach?

Thank you
Arnie
Arnie
Posts: 33
Joined: Wed May 28, 2008 4:27 pm

I am still looking for a solution for the back button. Any help or idea is appreciated
Thank you
Arnie
User avatar
Hopki
Gnome
Posts: 13015
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Hi Arnie,
I can't see how you would do this within the same player.
My only thoughts are to open a new HTML page, when you close it you would return back to the pano where you left off with the same pan, tilt and FoV.
Im thinking for a Pro project you can use Direct Node access and the target _blank.
The back button can be a simple javascript window close.

Source: Mouse Click
Action: Go To URL
URL: javascript:close();
Target:

Leave target blank.

Regards,
Hopki
Garden Gnome Support
If you send an e-mail to support please send a link to the forum post for reference.
support@ggnome.com
https://ggnome.com/wiki/documentation/
IronWagen
Posts: 47
Joined: Mon Nov 30, 2015 4:34 pm

I have done something similar once. I did it by pushing current node url into an array and then traversing the array in increasing or decreasing order by using back and forward buttons.

First I set the mouse click actions to both buttons. Forward button launches the getNext() function and back button launches getLast()
Image

Next I made my hs-move hotspots launch the pushNode() function that pushes the node url into the array:
Image

Just for clarity, I deleted the code for hiding the back and forward buttons if the array is empty

Code: Select all

var noderoute = []; //This array holds the visited nodes
var current = 0; //This variable keeps track of the current place within the array

//Pushes the node url into the noderoute array
	function pushNode(value){
		nodeid = value;
		noderoute.push(nodeid);
		current = noderoute.length-1;
	}

//Logic for the back button	
	function getLast(){
		if(current > 0){
			current = current-1;
			pano.openNext(noderoute[current]);
		}
	}

//Logic for the forward button	
	function getNext(){
		if(current < noderoute.length-1){
			current = current+1;
			pano.openNext(noderoute[current]);
		}
	}

The above project did not have the feature of saving the current view of each node.
I have done something like that for another project though.

Code: Select all

			
var pan = 0;
var tilt = 0;
var fov = 0;

	//Saves the pan tilt fov values
	//You can launch this function with the Mouse Click action
	function saveView(){
		pan = pano.getPan();
		tilt = pano.getTilt();
		fov = pano.getFov();	
	}

	//Sets the view with the pan tilt fov values
	//You can launch this with the load action. The load action should fire right after changing node	
	function setView(){
		pano.setPanTiltFov(pan,tilt,fov);
	}
			
This example does not cover the different pan, tilt, fov for each node. You could use another array or an object structure to save everything neatly.

I hope this helps
Post Reply