I have a similar problem, except I'm using reload(), not loadpano(), so I don't think the KEEPALL stuff is available to me. I have a pano, and I want to show a simple before/after kinda thing. I go through the six faces, adjust their src to a different path for the jpg. That doesn't do anything (as your documentation notes), so I have to call reload() which actually grabs and displays the new images. The problem is, my hotspots are gone! Why would those be affected if the scene is the exact same and I'm just swapping out the src of some images?
Here's the code, it's really simple. Figure if you want the before or after, then adjust the src values, then call reload().
|
Quellcode
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
var switchpano=false;
function showAltImg(){
switchpano=!switchpano;
var search='.jpg';
var replace='_alt.jpg';
if(!switchpano){
search='_alt.jpg';
replace='.jpg';
}
var sides=['front','back','left','right','up','down'];
for(var i=0;i<sides.length;i++){
var src=document.getElementById("krpanoSWFObject").get('image.'+sides[i]+'.url').replace(search,replace);
document.getElementById("krpanoSWFObject").set('image.'+sides[i]+'.url', src);
}
document.getElementById("krpanoSWFObject").call('reloadpano();');
}
|
Please view this example at:
http://archive.cyark.org/manzanar-reloca…ter-virtualtour
Click the little blue "bump" at the bottom to see the problem. There is a hotspot (due south) that goes to other panos that disappear.
I know about the keep="all" in the <hotspot>, but I don't want to do that because if I leave the pano, I want new hotspots.
I understand why you would wipe the hotspots on loadpano(). But would would you wipe the hotspots on reload()?
What should I do?