Detect Panorama movement

Special forum to share and discuss skins for Pano2VR and Object2VR
Post Reply
User avatar
Hopki
Gnome
Posts: 12999
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Hi,
This was a project built a long time back using Pano2VR 6 for a different problem, however, there was a recent Facebook question on how to close a map by clicking in the panorama.

pano_move.gif
pano_move.gif (904.54 KiB) Viewed 18077 times

The attached project is for Pano2VR 7 and uses the Code Element with javascript.

How it works:
There is a variable in the skin, var_map this is a true/false variable set to false which is used to show and hide the map element.
There is also a variable in the skin called: panoramaMoving, this is a true/false variable set to false.

There is a Code Element called: pano_move which has the javascript code.
What this does is detect when the panorama is moving and while it is moving it changes the variable: panoramaMoving to true.
When it stops it will go back to false.

The Code Element also has an action:

Screenshot 2023-03-28 at 17.58.58.png
Screenshot 2023-03-28 at 17.58.58.png (43.31 KiB) Viewed 18087 times

When the panorama is moved the javascript code changes the variable to true.
The action Variable Changed is looking at this variable and when it changes, causes a trigger that will Set Variable Value, var_map, to false.

The toggle map button is just toggling the variable var_map between true and false. If it's true and the map is open, moving the pano will close it.
If it is already closed, then moving the pano will do nothing as it is already closed, set to false.

Regards,
Attachments
pano_move.zip
(25.4 KiB) Downloaded 241 times
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/
Post Reply