JS api current panorama
- JimWatters
- Posts: 329
- Joined: Thu Oct 07, 2010 6:16 pm
- Location: Saint John, New Brunswick
- Contact:
If you look at the code generated by enabling "Include Google Maps" and "Direct node access" on HTML5 Output | HTML
you should see what you need.
you should see what you need.
- Jim Watters
http://photocreations.ca
http://photocreations.ca
all panoramas created in the swf. I want to get the current current swf, which is viewed by the user.JimWatters wrote:If you look at the code generated by enabling "Include Google Maps" and "Direct node access" on HTML5 Output | HTML
you should see what you need.
In js api described as a move to the desired panorama
pano.openNext(<url:String>,<parameter:String>); // Open next panorama
- JimWatters
- Posts: 329
- Joined: Thu Oct 07, 2010 6:16 pm
- Location: Saint John, New Brunswick
- Contact:
You need the pro version of Pano2VR and you need to enable direct node access in the HTML tab of Flash Output.
I used getCurrentNode to sync left and right view to the same node in a tour.
I used getCurrentNode to sync left and right view to the same node in a tour.
Code: Select all
// syncronize both panoramas
var lastPan,lastTilt,lastFov,lastLeft,lastRigth;
lastLeft=pano_left.getCurrentNode();
lastRight=pano_right.getCurrentNode();
function syncPanos() {
try {
if(lastRight!==pano_right.getCurrentNode()){
pano_left.openNext("{" + pano_right.getCurrentNode() + "}", "$cur");
}
else if(lastLeft!==pano_left.getCurrentNode()){
pano_right.openNext("{" + pano_left.getCurrentNode() + "}", "$cur");
}
lastLeft=pano_left.getCurrentNode();
lastRight=pano_right.getCurrentNode();
var panoSrc=pano_left;
var panoDst=pano_right;
if ((lastPan!=pano_right.getPan()) ||
(lastTilt!=pano_right.getTilt()) ||
(lastFov!=pano_right.getFov())) {
panoSrc=pano_right;
panoDst=pano_left;
}
lastPan=panoSrc.getPan();
lastTilt=panoSrc.getTilt();
lastFov=panoSrc.getFov();
panoDst.setPanTiltFov(lastPan,lastTilt,lastFov);
} catch(e) {}
}
setInterval ( "syncPanos()", 10 );
syncPanos();
- Jim Watters
http://photocreations.ca
http://photocreations.ca