I had the same problem, and found a solution using the "parent" feature, because I noticed that when I make the parent invisible, then all children are invisible as well.
I'm posting it here, hoping it might help someone.
I have a floorplan image defined as a plugin called "map", and I need to be able to show and hide the hotspots on it. So, I made an extra "plugin" layer between the map and the hotspots, called "group". Group's parent is "map". The hotspots' parents are "group". The url for "group" is a transparent gif, and its set to 100% width and height, so that it invisibly covers "map".
In this way, by changing the "visible" state of " group", I can hide all hotspots at once, without hiding the floorplan itself.
|
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
32
33
34
35
36
37
38
39
40
41
42
43
|
<plugin name="map"
url="/images/floorplan.png"
x="10"
y="10"
height="40%"
width="prop"
alpha="0.90"
handcursor="false"
visible="true"
/>
<plugin name="group"
parent="plugin[map]"
url="/images/6pix_transparent.gif"
origin="lefttop"
edge="lefttop"
width="100%"
height="100%"
/>
<style name="buttonstyle"
parent="plugin[group]"
origin="lefttop"
edge="center"
/>
<plugin name="button001" style="buttonstyle"
url="images/hotspot.gif"
onclick="action(newPano, Pano001);"
x="75.0%"
y="43.7%"
/>
(etc.)
<plugin name="button009" style="buttonstyle"
url="images/hotspot.gif"
onclick="action(newPano, Pano009);"
x="15.0%"
y="63.2%"
/>
<action name="showhotspots">
<!-- %1 = true or false -->
set(plugin[group].visible, %1);
</action>
|
So, calling
action(showhotspots, true|false) will affect all defined hotspots at once, while the map remains unaffected.