You are not logged in.

mstoss

Intermediate

  • "mstoss" started this thread

Posts: 297

Location: Berlin

  • Send private message

1

Wednesday, January 23rd 2013, 1:30pm

Switching showtext according to chosen language?

Language switch, again...

When the user hovers over the map hotspots, the scene name shall show up according to the chosen language. I thought this would be a simple task and tried the following:

- Create a list of variables with the names consisting of the language setting and spot number and the value being the descriptive text
- Create an action which generates the 'onhover="showtext(spotnamedescription_03,smalltext);" 'parameter

But I don't seem to have a proper understanding of how the variables work. Can anybody help to get that right?

Source code

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
set(mp_gb_01,this is the english description of spot 1);
set(mp_gb_02, this is the english description of spot 2);
(...)
set(mp_d_01, Dies ist der deutsche Mapspot-Titel 1);
set(mp_d_02, Dies ist der deutsche Mapspot-Titel 2);

	<action name="a_setmpointname">
trace(mp_gb_01); # already this part only gives me a "mp_gb_01" 
result. So obviously I am doing something wrong with defining the 
variables, don't I?
trace(%1); # gives me 01 as desired
trace(v_lang); # gives me the language value (e.g. "gb") as disired
				copy(v_content, mp_(get(v_lang)_%1) );
				trace(v_content);
				set(plugin[mp_%1].onhover,showtext(get(v_content),smalltext));
	</action>


	<plugin name="mp_01" 
	url="../icons/mapspot-2.gif" 
	keep="true" 
	alpha="1"
	parent="floorplan" 
	align="lefttop" 
	edge="center" 
	x="175" 
	y="192" 
	zorder="2" 
	onhover="a_setmpointname(01);" 
	onclick="loadscene(scene_01, null, MERGE, BLEND(1));"/>

	<plugin name="mp_02"  etc



So where is my error?

Any help very much appreciated, thank you

Michael

mstoss

Intermediate

  • "mstoss" started this thread

Posts: 297

Location: Berlin

  • Send private message

2

Wednesday, January 23rd 2013, 11:10pm

Solved! Thanks to Piotr in this thread: title tag localisation

Source code

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
<mptit name="de">
  <item name="mp_01" val="deutsch-1" />
  <item name="mp_02" val="deutsch-2" />
  <item name="mp_03" val="deutsch-3"  />
</mptit>

<mptit name="gb">
  <item name="mp_01" val="englisch 1" />
  <item name="mp_02" val="englisch 2" />
  <item name="mp_03" val="englisch 3" />
</mptit>

<action name="a_setmpointname">

set(
v_mp-tit,get(mptit[get(v_lang)].item[%1].val)			
	);
	set(plugin[%1].onhover,showtext(get(v_mp-tit),smalltext));
</action>


	<plugin name="mp_01" 
	url="../icons/mapspot-2.gif" 
	keep="true" 
	alpha="1"
	parent="floorplan" 
	align="lefttop" 
	edge="center" 
	x="175" 
	y="192" 
	zorder="2" 
	onhover="a_setmpointname(mp_01);" 
	onclick="loadscene(scene_01, null, MERGE, BLEND(1));"/>

mstoss

Intermediate

  • "mstoss" started this thread

Posts: 297

Location: Berlin

  • Send private message

3

Wednesday, January 23rd 2013, 11:57pm

:-( Not yet solved completely...

Strange issue: Now I added 40 map hotspots with a titel in 2 languages each. But the hover information is not refreshed every time. That means, that you hover over some hotspots with the right titel and then again the titel is getting stuck with the last hotspot titel for some few new hotspots. Tracing the values shows exactly that: the values are not being refreshed. Why is that???

edit: this happens even with only 2 hotspots on the map...

Michael

This post has been edited 1 times, last edit by "mstoss" (Jan 24th 2013, 12:12am)


spacerywirtualne

Professional

Posts: 1,117

Location: Poland, Europe

Occupation: krpano developer : virtual tours : the cms4vr owner

  • Send private message

4

Thursday, January 24th 2013, 9:26am

Hi

Do you have this project online somewhere *question*

Piotr
Your own professional, online cloud tool for creating virtual tours - www.cms4vr.com

facebook page :: youtube :: wiki.cms4vr.com

cms4vr team *thumbsup*

mstoss

Intermediate

  • "mstoss" started this thread

Posts: 297

Location: Berlin

  • Send private message

5

Thursday, January 24th 2013, 10:22am

Piotr, I sent you an email.

spacerywirtualne

Professional

Posts: 1,117

Location: Poland, Europe

Occupation: krpano developer : virtual tours : the cms4vr owner

  • Send private message

6

Thursday, January 24th 2013, 11:11am

I sent an email to you, too *thumbup*

Piotr
Your own professional, online cloud tool for creating virtual tours - www.cms4vr.com

facebook page :: youtube :: wiki.cms4vr.com

cms4vr team *thumbsup*

mstoss

Intermediate

  • "mstoss" started this thread

Posts: 297

Location: Berlin

  • Send private message

7

Thursday, January 24th 2013, 12:55pm

This is the mappoint-xml as it is now. I have set two hotspots to receive their title information via an IF-condition for control purposes.

Source code

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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<krpano version="1.0.8.15" >

<mptit name="de">
  <item name="mp_01" val="deutsch-1" />
  <item name="mp_02" val="deutsch-2" />
  <item name="mp_03" val="deutsch-3"  />
  <item name="mp_04" val="deutsch-4" />
  <item name="mp_05" val="deutsch-5" />
  <item name="mp_06" val="deutsch-6"  />
  <item name="mp_07" val="deutsch-7" />
  <item name="mp_08" val="deutsch-8" />

</mptit>

<mptit name="gb">
  <item name="mp_01" val="englisch 1" />
  <item name="mp_02" val="englisch 2" />
  <item name="mp_03" val="englisch 3"  />
  <item name="mp_04" val="englisch 4" />
  <item name="mp_05" val="englisch 5" />
  <item name="mp_06" val="englisch 6"  />
  <item name="mp_07" val="englisch 7" />
  <item name="mp_08" val="englisch 8" />
  
</mptit>

<action name="a_setmpointname">
trace(v_lang);
trace(%1);
trace(
mptit[get(v_lang)].item[%1].val			
	);
set(
v_mp-tit,get(mptit[get(v_lang)].item[%1].val)			
	);
	set(plugin[%1].onhover,showtext(get(v_mp-tit),smalltext));
</action>


	<plugin name="mp_01" 
	url="../icons/mapspot-2.gif" 
	keep="true" 
	alpha="1"
	parent="floorplan" 
	align="lefttop" 
	edge="center" 
	x="175" 
	y="192" 
	zorder="2" 
	onhover="a_setmpointname(mp_01);" 
	onclick="loadscene(scene_01, null, MERGE, BLEND(1));"/>

	<plugin name="mp_02" 
	url="../icons/mapspot-2.gif" 
	keep="true" 
	alpha="1"
	parent="floorplan" 
	align="lefttop" 
	edge="center" 
	x="132" 
	y="192" 
	zorder="2" 
	onhover="a_setmpointname(mp_02);" 
	onclick="loadscene(scene_02, null, MERGE, BLEND(1));"/>

	<plugin name="mp_03" 
	url="../icons/mapspot-2.gif" 
	keep="true" 
	alpha="1"
	parent="floorplan" 
	align="lefttop" 
	edge="center" 
	x="134" 
	y="141" 
	zorder="2" 
	onhover="if(v_lang==de,
				showtext(IF deutscher Titel 03,smalltext);
			  );
			if(v_lang==gb,
				showtext(IF english title 03,smalltext);	
			  );" 
	onclick="loadscene(scene_03, null, MERGE, BLEND(1));"/>

	<plugin name="mp_04" 
	url="../icons/mapspot-2.gif" 
	keep="true" 
	alpha="1"
	parent="floorplan" 
	align="lefttop" 
	edge="center" 
	x="175" 
	y="242" 
	zorder="2" 
	onhover="if(v_lang==de,
				showtext(IF deutscher Titel 04,smalltext);
			  );
			if(v_lang==gb,
				showtext(IF english title 04,smalltext);	
			  );" 

	onclick="loadscene(scene_04, null, MERGE, BLEND(1));"/>

	<plugin name="mp_05" 
	url="../icons/mapspot-2.gif" 
	keep="true" 
	alpha="1"
	parent="floorplan" 
	align="lefttop" 
	edge="center" 
	x="210" 
	y="192" 
	zorder="2" 
	onhover="a_setmpointname(mp_05);" 
	onclick="loadscene(scene_05, null, MERGE, BLEND(1));"/>

	<plugin name="mp_06" 
	url="../icons/mapspot-2.gif" 
	keep="true" 
	alpha="1"
	parent="floorplan" 
	align="lefttop" 
	edge="center" 
	x="246" 
	y="192" 
	zorder="2" 
	onhover="a_setmpointname(mp_06);" 
	onclick="loadscene(scene_06, null, MERGE, BLEND(1));"/>
	
	<plugin name="mp_07" 
	url="../icons/mapspot-2.gif" 
	keep="true" 
	alpha="1"
	parent="floorplan" 
	align="lefttop" 
	edge="center" 
	x="296" 
	y="192" 
	zorder="2" 
	onhover="a_setmpointname(mp_07);" 
	onclick="loadscene(scene_07, null, MERGE, BLEND(1));"/>
	
	<plugin name="mp_08" 
	url="../icons/mapspot-2.gif" 
	keep="true" 
	alpha="1"
	parent="floorplan" 
	align="lefttop" 
	edge="center" 
	x="333" 
	y="192" 
	zorder="2" 
	onhover="a_setmpointname(mp_08);" 
	onclick="loadscene(scene_08, null, MERGE, BLEND(1));"/>



		
</krpano>

mstoss

Intermediate

  • "mstoss" started this thread

Posts: 297

Location: Berlin

  • Send private message

8

Sunday, February 3rd 2013, 2:01pm

Hi Piotr,

I decided to switch over to the IF-version in the end. I could not find the error, but I'm sure it was only some typo anywhere. I was running out of time so I stopped fiddling around with that. Your approach is working, I used it for the original localisation issue to be found in this thread:

title tag localisation

So, many thanks again for your help.

spacerywirtualne

Professional

Posts: 1,117

Location: Poland, Europe

Occupation: krpano developer : virtual tours : the cms4vr owner

  • Send private message

9

Sunday, February 3rd 2013, 2:16pm

I'm glad it works for you.
*thumbup*

regards

Piotr
Your own professional, online cloud tool for creating virtual tours - www.cms4vr.com

facebook page :: youtube :: wiki.cms4vr.com

cms4vr team *thumbsup*