Hello there,
I made a tour with map and and a show/hide button for the map.
When there's only one level, no problem.
When more levels are involved the following happens (most of the time) :
- after I changed level, using the hotspots or the level indicators on the left, I can hide the map but most of the times I can't get it back.
- I see that the images show/hide map are changing though.
- With the map active (but not visible),I go back to level 0, and there map 0 appears..
- But once the map has failed to come back it won't stop
Here is the project : http://www.immo-virtueel.be/360_cam_d/
Does someone has an idea what this could be ?
see script below
THANKS !
=servaas=
map.xml
Code
<krpano>
<floors current="" spoturl="%SWFPATH%/hotspots/mapspot.png">
<floor name="f1" title="Niv. 1" mapurl="%SWFPATH%/floorplans/1.png">
<spot name="scene_terras 02" x="162" y="162" heading="90" />
</floor>
<floor name="f0" title="Niv. 0" mapurl="%SWFPATH%/floorplans/0.png">
<spot name="scene_salon" x="170" y="410" heading="-90" />
<spot name="scene_keuken" x="200" y="325" heading="-90" />
<spot name="scene_kamer 01" x="155" y="245" heading="90" />
<spot name="scene_badkamer" x="145" y="210" heading="0" />
<spot name="scene_kamer 02" x="165" y="150" heading="10" />
<spot name="scene_terras 01" x="175" y="40" heading="100" />
</floor>
</floors>
<!-- CSS van de verschillende mouse states van de verdiepings knop -->
<data name="OverCSS">
p{
margin:0;
color: #FFFFFF;
font-family: Arial;
font-size: 18px;
text-align: topleft;
}
</data>
<data name="ActiveCSS">
p{ margin:0;
color: #bd2a33;
font-family: Arial;
font-size: 18px;
text-align: center;
}
</data>
<data name="NormalCSS">
p{ margin:0;
color: #002b6d;
font-family: Arial;
font-size: 18px;
text-align: center;
}
</data>
<data name="FloorTitleCSS">
p{ margin:0;
color: #bd2a33;
font-family: Helvetica;
font-size: 12px;
text-align: left;
}
</data>
<plugin name="map" url="%SWFPATH%/floorplans/0.png" keep="true" align="righttop" x="0" y="76" alpha="0.9" handcursor="false"/>
<!-- for some reason, parent="map" gives issues, so the x/y need to be set, change if the map gets wider -->
<plugin name="floortitle" background="false" url="%SWFPATH%/plugins/textfield.swf"
html="[p]1[/p]" css="data:FloorTitleCSS" height="20" width="100"
children="false" zorder="101" x="7" y="50" keep="true" align="righttop"
/>
<plugin name="radar" url="%SWFPATH%/plugins/radar.swf" alturl="%SWFPATH%/plugins/radar.js"
heading="0"
fillcolor="0xbd2a33"
fillalpha="0.4"
linecolor="0xbd2a33"
linewidth="2"
linealpha="0.5"
align="center" x="0" y="0" keep="true" edge="center" zorder="250"
capture="false" children="true" width="75" height="75"
/>
<plugin name="showhidemap" url="%SWFPATH%/images/plan_verberg.png"
onclick="toggle_map()" align="topright" keep="true"
zorder="101" children="false"
alpha="1.0"
/>
<action name="toggle_map">
switch(plugin[map].visible);
if(plugin[map].visible,
set(plugin[showhidemap].url, %SWFPATH%/images/plan_verberg.png);
,
set(plugin[showhidemap].url, %SWFPATH%/images/plan_toon.png);
);
</action>
<!-- Generate floor buttons -->
<action name="create_floor_buttons">
copy(floor_menu_yoffset, menu.yoffset);
<!-- new feature in krpano 1.14 RC3: for() -->
for(set(i,0), i LT floors.floor.count, inc(i),
set(floor_btn, '');
txtadd(floor_btn, 'floorbtn_', get(floors.floor[get(i)].name));
<!-- add the floor_btn -->
addplugin(get(floor_btn));
set(plugin[get(floor_btn)].type, floorbtn);
copy(plugin[get(floor_btn)].ref, floors.floor[get(i)].name);
copy(plugin[get(floor_btn)].tooltip, floors.floor[get(i)].title);
set(plugin[get(floor_btn)].align,topleft);
set(plugin[get(floor_btn)].children,false);
set(plugin[get(floor_btn)].enabled,true);
set(plugin[get(floor_btn)].zorder,101);
set(plugin[get(floor_btn)].background,true);
set(plugin[get(floor_btn)].url, %SWFPATH%/plugins/textfield.swf);
set(plugin[get(floor_btn)].keep,true);
<!-- set the style and coloring -->
if(floors.floor[get(i)].name == floors.current,
set(plugin[get(floor_btn)].active, true);
set(plugin[get(floor_btn)].css,data:ActiveCSS);
copy(plugin[get(floor_btn)].backgroundcolor, menu.floor.active.backgroundcolor);
copy(plugin[get(floor_btn)].alpha, menu.floor.active.alpha);
,
copy(plugin[get(floor_btn)].backgroundcolor, menu.floor.normal.backgroundcolor);
copy(plugin[get(floor_btn)].alpha, menu.floor.normal.alpha);
set(plugin[get(floor_btn)].css,data:NormalCSS);
set(plugin[get(floor_btn)].active, false);
);
copy(plugin[get(floor_btn)].borderwidth, menu.floor.borderwidth);
copy(plugin[get(floor_btn)].bordercolor, menu.floor.bordercolor);
set(plugin[get(floor_btn)].jsborder, '1px solid #FFFFFF');
<!-- width and height -->
copy(plugin[get(floor_btn)].width, menu.floor.width);
copy(plugin[get(floor_btn)].height, menu.floor.height);
<!-- put the buttons under eachother -->
copy(plugin[get(floor_btn)].y, floor_menu_yoffset);
add(floor_menu_yoffset, get(plugin[get(floor_btn)].height));
add(floor_menu_yoffset, menu.floor.padding);
copy(plugin[get(floor_btn)].x, menu.xoffset);
<!-- set the text -->
set(_floorbtnhtml, '');
txtadd(_floorbtnhtml, <p>, get(floors.floor[get(i)].title), </p>);
set(plugin[get(floor_btn)].html, get(_floorbtnhtml));
<!-- mouse events -->
set(plugin[get(floor_btn)].onover,
ifnot(active,
copy(backgroundcolor, menu.floor.over.backgroundcolor);
copy(alpha, menu.floor.over.alpha);
set(css,data:OverCSS);
);
);
set(plugin[get(floor_btn)].onout,
ifnot(active,
copy(backgroundcolor, menu.floor.normal.backgroundcolor);
copy(alpha, menu.floor.normal.alpha);
set(css,data:OverCSS);
);
);
set(plugin[get(floor_btn)].onclick,
ifnot(active,
change_floor(get(ref), TRUE);
);
);
);
</action>
<action name="load_map">
copy(plugin[map].url, floors.floor[get(floors.current)].mapurl);
<!--copy(plugin[mapmask].url, floors.floor[get(floors.current)].mapurl);-->
load_spots();
<!--load map hotspots set(plugin[radar].mask, plugin[mapmask]); -->
</action>
<action name="load_spots">
for(set(spotcount, 0), spotcount LT floors.floor[get(floors.current)].spot.count, inc(spotcount),
txtadd(rspot, spot_, get(floors.floor[get(floors.current)].spot[get(spotcount)].name));
addplugin(get(rspot));
copy(plugin[get(rspot)].url, floors.spoturl);
copy(plugin[get(rspot)].x, floors.floor[get(floors.current)].spot[get(spotcount)].x);
copy(plugin[get(rspot)].y, floors.floor[get(floors.current)].spot[get(spotcount)].y);
copy(plugin[get(rspot)].ref, floors.floor[get(floors.current)].spot[get(spotcount)].name);
set(plugin[get(rspot)].type, maphotspot);
set(plugin[get(rspot)].align, topleft);
set(plugin[get(rspot)].edge, center);
set(plugin[get(rspot)].parent, plugin[map]);
set(plugin[get(rspot)].keep, true);
set(plugin[get(rspot)].enabled, true);
set(plugin[get(rspot)].handcursor, true);
set(plugin[get(rspot)].onclick, change_location(get(ref)));
set(plugin[get(rspot)].onhover, show_tooltip(get(panoramas.pano[get(ref)].tooltip)));
);
</action>
<action name="set_floor_btn_inactive">
<!-- set previous floor btn inactive -->
set(inactivefloor_btn, '');
txtadd(inactivefloor_btn, 'floorbtn_', get(floors.current));
copy(plugin[get(inactivefloor_btn)].backgroundcolor, menu.floor.normal.backgroundcolor);
copy(plugin[get(inactivefloor_btn)].alpha, menu.floor.normal.alpha);
set(plugin[get(inactivefloor_btn)].active, false);
set(plugin[get(inactivefloor_btn)].css,data:NormalCSS);
</action>
<action name="set_floor_btn_active">
<!-- set the floor btn active -->
set(activefloor_btn, '');
txtadd(activefloor_btn, 'floorbtn_', get(floors.current));
set(plugin[get(activefloor_btn)].active, true);
copy(plugin[get(activefloor_btn)].backgroundcolor, menu.floor.active.backgroundcolor);
copy(plugin[get(activefloor_btn)].alpha, menu.floor.active.alpha);
set(plugin[get(activefloor_btn)].css,data:ActiveCSS);
</action>
<action name="remove_map">
for(set(spotcount, 0), spotcount LT floors.floor[get(floors.current)].spot.count, inc(spotcount),
txtadd(rspot, spot_, get(floors.floor[get(floors.current)].spot[get(spotcount)].name));
if(plugin[get(rspot)] !== null,
removeplugin(get(rspot));
);
);
</action>
</krpano>
Display More
related parts out of interface.xml :
Code
<menu xoffset="0" yoffset="60" backgroundcolor="0x666666" alpha="0.8">
<floor padding="10" width="60" height="35" borderwidth="0" bordercolor="0xFFFFFF">
<normal backgroundcolor="0xFFFFFF" alpha="0.5" />
<over backgroundcolor="0xFFFFFF" alpha="0.9" />
<active backgroundcolor="0xFFFFFF" alpha="0.9" />
</floor>
<thumbnail width="100" height="30" textheight="20" padding="20" borderwidth="0" bordercolor="0xFFFFFF">
<normal alpha="0.2" />
<over alpha="0.6" />
<active alpha="0.8" />
</thumbnail>
</menu>
<!-- Locatie naam -->
<plugin name="locationtitle" url="%SWFPATH%/plugins/textfield.swf" background="false"
keep="true" x="-90" y="50" align="topright" zorder="102" children="false" handcursor="false"
backgroundcolor="0x41404b" border="0" bordercolor="0xFFFFFF"
width="400" height="20" html="test" css="data:TopMenuCSS"
/>
<action name="change_floor">
<!-- if the current panorama is not on this floor, load the first panorama of this floor -->
if(%2,
change_location(get(floors.floor[%1].spot[0].name));
);
set_floor_btn_inactive();
remove_map();
set(floors.current, %1);
set_floor_btn_active();
load_thumbnails();
load_map();
set(_floortitle, '');
txtadd(_floortitle, '[p] ',get(floors.floor[%1].title),'[/p]');
copy(plugin[floortitle].html, _floortitle);
</action>
<action name="change_location">
<!-- sets the old current inactive-->
txtadd(inactivethumb,'thumb_', get(panoramas.current));
copy(plugin[get(inactivethumb)].alpha, menu.thumbnail.normal.alpha);
set(plugin[get(inactivethumb)].active, false);
<!-- set new active -->
set(panoramas.current, %1);
<!-- update the title -->
set(_locationtitle, '');
txtadd(_locationtitle, <p>, get(panoramas.pano[get(panoramas.current)].tooltip), </p>);
set(plugin[locationtitle].html, get(_locationtitle));
<!-- change the floor/thumbnail bar if the location isnt on the current floor -->
if(floors.current != panoramas.pano[get(panoramas.current)].floor,
change_floor(get(panoramas.pano[get(panoramas.current)].floor));
);
loadscene(get(panoramas.current), null, MERGE, BLEND(1));
<!-- set thumb active -->
txtadd(activethumb,'thumb_', get(panoramas.current));
set(plugin[get(activethumb)].alpha, get(menu.thumbnail.active.alpha));
set(plugin[get(activethumb)].active, true);
<!-- move the radar -->
txtadd(activespot, spot_, get(panoramas.current));
set(plugin[radar].visible, false);
delayedcall(0.01,
copy(plugin[radar].parent, activespot);
set(plugin[radar].visible, true);
copy(plugin[radar].heading, floors.floor[get(panoramas.pano[get(panoramas.current)].floor)].spot[get(panoramas.current)].heading);
);
</action>
Display More