You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Monday, October 7th 2019, 3:34pm

combo box to load in specific scene

I need the combo box to load in the first scene only. Here's an example of the corfu tour with three scenes.
I've included keep="false" within the combo box element in the 1st scene. You would expect it should appear every time you load the 1st scene ONLY.


The combo box will keep appearing in the second and third scenes but will disappear on re-entering the 1st scene and not appear again on any subsequent scene change.
( I've tested with the previous version of the combo box using the swf and js files, it was working correctly--could this be a bug in the new xml version?)
Any suggestion?

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
<krpano title="Corfu Holiday Trip">
	
	<include url="skin/vtourskin.xml" />
	<include url="%VIEWER%/plugins/combobox.xml" />



	<!-- customize skin settings: maps, gyro, webvr, thumbnails, tooltips, layout, design, ... -->
	<skin_settings maps="true"
	           	maps_type="custom"
	           	maps_bing_api_key=""
	           	maps_google_api_key=""
	           	maps_zoombuttons="false"
	           	maps_loadonfirstuse="true"
	           	gyro="true"
	           	gyro_keeplookingdirection="false"
	           	webvr="true"
	           	webvr_keeplookingdirection="true"
	           	webvr_prev_next_hotspots="true"
	           	littleplanetintro="false"
	           	followmousecontrol="false"
	           	title="true"
	           	thumbs="true"
	           	thumbs_width="120" thumbs_height="80" thumbs_padding="10" thumbs_crop=""
	           	thumbs_opened="false"
	           	thumbs_text="true"
	           	thumbs_dragging="true"
	           	thumbs_onhoverscrolling="false"
	           	thumbs_scrollbuttons="false"
	           	thumbs_scrollindicator="false"
	           	thumbs_loop="false"
	           	tooltips_buttons="false"
	           	tooltips_thumbs="false"
	           	tooltips_hotspots="false"
	           	tooltips_mapspots="false"
	           	deeplinking="false"
	           	loadscene_flags="MERGE"
	           	loadscene_blend="OPENBLEND(0.5, 0.0, 0.75, 0.05, linear)"
	           	loadscene_blend_prev="SLIDEBLEND(0.5, 180, 0.75, linear)"
	           	loadscene_blend_next="SLIDEBLEND(0.5,   0, 0.75, linear)"
	           	loadingtext="loading..."
	           	layout_width="100%"
	           	layout_maxwidth="814"
	           	controlbar_width="-24"
	           	controlbar_height="40"
	           	controlbar_offset="20"
	           	controlbar_offset_closed="-40"
	           	controlbar_overlap.no-fractionalscaling="10"
	           	controlbar_overlap.fractionalscaling="0"
	           	design_skin_images="vtourskin.png"
	           	design_bgcolor="0x304954"
	           	design_bgalpha="0.7"
	           	design_bgborder="0"
	           	design_bgroundedge="1"
	           	design_bgshadow="0 4 10 0x000000 0.3"
	           	design_thumbborder_bgborder="3 0xFFFFFF 1.0"
	           	design_thumbborder_padding="2"
	           	design_thumbborder_bgroundedge="0"
	           	design_text_css="color:#FFFFFF; font-family:Arial;"
	           	design_text_shadow="1"
	           	/>




	<!-- startup action - load the first scene -->
	<action name="startup" autorun="onstart">
		if(startscene === null OR !scene[get(startscene)], copy(startscene,scene[0].name); );
		loadscene(get(startscene), null, MERGE);
		if(startactions !== null, startactions() );
	</action>
	


	<scene name="scene_achilleion-hof-unten" title="Achilleion - Garden" onstart="" thumburl="panos/achilleion-hof-unten.tiles/thumb.jpg" lat="39.563340" lng="19.904324" heading="0.0">

		<view hlookat="-1" vlookat="11" fovtype="MFOV" fov="120" fovmin="70" fovmax="140" limitview="auto" />

		<preview url="panos/achilleion-hof-unten.tiles/preview.jpg" />

		<image>
			<cube url="panos/achilleion-hof-unten.tiles/mobile_%s.jpg" if="browser.domain != 'krpano.com'" />
			<cube url="https://krpano.com/tours/corfu/panos/achilleion-hof-unten.tiles/%s/l%l/%v/l%l_%s_%v_%h.jpg" multires="512,768,1536,2816" if="browser.domain == 'krpano.com'" />
		</image>

	<!-- static example -->
	<combobox name="cbsettings" keep="false" design="vtour" align="righttop" x="10" y="10" onchange="selectItemByName(0);">
		<item name="item0" caption="SETTINGS" />
		<item name="item1" caption="Drag Control"   	onclick="set(control.mouse,drag); set(control.touch,drag);" />
		<item name="item2" caption="Move Control"   	onclick="set(control.mouse,moveto); set(control.touch,moveto);" />
		<item name="item3" caption="Normal View"    	onclick="cm_normal_view();" />
		<item name="item4" caption="Fisheye View"   	onclick="cm_fisheye_view();" />
		<item name="item5" caption="Stereographic View" onclick="cm_stereographic_view();" />
		<item name="item6" caption="Architectural View" onclick="cm_architectural_view();" />
		<item name="item7" caption="Pannini View"   	onclick="cm_pannini_view();" />
		<item name="item8" caption="Little Planet View" onclick="cm_littleplanet_view();" />
	</combobox>


	</scene>

	<scene name="scene_canaldemure5" title="Canal d´Amour 2" onstart="" thumburl="panos/canaldemure5.tiles/thumb.jpg" lat="39.796233694" lng="19.70181763" heading="0.0">

		<view hlookat="-118" vlookat="4" fovtype="MFOV" fov="132" fovmin="70" fovmax="140" limitview="auto" />

		<preview url="panos/canaldemure5.tiles/preview.jpg" />

		<image>
			<cube url="panos/canaldemure5.tiles/mobile_%s.jpg" if="browser.domain != 'krpano.com'" />
			<cube url="https://krpano.com/tours/corfu/panos/canaldemure5.tiles/%s/l%l/%v/l%l_%s_%v_%h.jpg" multires="512,768,1536,2816" if="browser.domain == 'krpano.com'" />
		</image>

	</scene>

	<scene name="scene_kalamaki-strand" title="Kalamaki Beach 2" onstart="" thumburl="panos/kalamaki-strand.tiles/thumb.jpg" lat="39.7989065" lng="19.8847845" heading="0.0">

		<view hlookat="18" vlookat="1" fovtype="MFOV" fov="120" fovmin="70" fovmax="140" limitview="auto" />

		<preview url="panos/kalamaki-strand.tiles/preview.jpg" />

		<image>
			<cube url="panos/kalamaki-strand.tiles/mobile_%s.jpg" if="browser.domain != 'krpano.com'" />
			<cube url="https://krpano.com/tours/corfu/panos/kalamaki-strand.tiles/%s/l%l/%v/l%l_%s_%v_%h.jpg" multires="512,1152,2176" if="browser.domain == 'krpano.com'" />
		</image>

	</scene>

</krpano>

This post has been edited 4 times, last edit by "Islander" (Oct 19th 2019, 8:11pm)


2

Saturday, October 19th 2019, 8:14pm

Here's a live view of the simple tour with the combo box issue.

http://mauritius360.com/test4/index.html

3

Sunday, October 20th 2019, 7:20am

But if the layer is created dynamically, then it becomes global and keep does not work.
You have taken old actions for setting views, so they do not work.

This post has been edited 1 times, last edit by "San7" (Oct 20th 2019, 7:37am)


4

Sunday, October 20th 2019, 7:55pm

Hi San,
This combo box example is static example from the latest example in KR pano. So what setting(s) in your opinion would make the Keep="false" work?

5

Monday, October 21st 2019, 1:42pm

Yes, the combo box is registered static, but it creates a list layer dynamically.
You can record in the style used
<style name="combobox_container_style" ... onloaded="set(cb_N,get(name));"



cb_N - the variable contains the name of the combo box container.

Now you can turn it on / off when you need, for example:


<scene ... onstart="set(layer[get(cb_N )].visible,false); set(layer[get(cb_N )].enable,false);"

6

Monday, October 21st 2019, 5:00pm

This is the new xml file as you advised:

But now I don't get any layers, for example even the thumb layer goes away in the second scene "canaldemure5". Please correct me if I've done something wrong.
http://mauritius360.com/test4/index.html

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
<krpano title="Corfu Holiday Trip">
	
	<include url="skin/vtourskin.xml" />
	<include url="plugins/combobox.xml" />



	<!-- customize skin settings: maps, gyro, webvr, thumbnails, tooltips, layout, design, ... -->
	<skin_settings maps="true"
	       		maps_type="custom"
	       		maps_bing_api_key=""
	       		maps_google_api_key=""
	       		maps_zoombuttons="false"
	       		maps_loadonfirstuse="true"
	       		gyro="true"
	       		gyro_keeplookingdirection="false"
	       		webvr="true"
	       		webvr_keeplookingdirection="true"
	       		webvr_prev_next_hotspots="true"
	       		littleplanetintro="false"
	       		followmousecontrol="false"
	       		title="true"
	       		thumbs="true"
	       		thumbs_width="120" thumbs_height="80" thumbs_padding="10" thumbs_crop=""
	       		thumbs_opened="true"
	       		thumbs_text="true"
	       		thumbs_dragging="true"
	       		thumbs_onhoverscrolling="false"
	       		thumbs_scrollbuttons="false"
	       		thumbs_scrollindicator="false"
	       		thumbs_loop="false"
	       		tooltips_buttons="false"
	       		tooltips_thumbs="false"
	       		tooltips_hotspots="false"
	       		tooltips_mapspots="false"
	       		deeplinking="false"
	       		loadscene_flags="MERGE"
	       		loadscene_blend="OPENBLEND(0.5, 0.0, 0.75, 0.05, linear)"
	       		loadscene_blend_prev="SLIDEBLEND(0.5, 180, 0.75, linear)"
	       		loadscene_blend_next="SLIDEBLEND(0.5,   0, 0.75, linear)"
	       		loadingtext="loading..."
	       		layout_width="100%"
	       		layout_maxwidth="814"
	       		controlbar_width="-24"
	       		controlbar_height="40"
	       		controlbar_offset="20"
	       		controlbar_offset_closed="-40"
	       		controlbar_overlap.no-fractionalscaling="10"
	       		controlbar_overlap.fractionalscaling="0"
	       		design_skin_images="vtourskin.png"
	       		design_bgcolor="0x304954"
	       		design_bgalpha="0.7"
	       		design_bgborder="0"
	       		design_bgroundedge="1"
	       		design_bgshadow="0 4 10 0x000000 0.3"
	       		design_thumbborder_bgborder="3 0xFFFFFF 1.0"
	       		design_thumbborder_padding="2"
	       		design_thumbborder_bgroundedge="0"
	       		design_text_css="color:#FFFFFF; font-family:Arial;"
	       		design_text_shadow="1"
	       		/>


	<style name="combobox_container_style"
	   	onloaded="set(cb_N,get(cbsettings));"
	   	/>

	<!-- startup action - load the first scene -->
	<action name="startup" autorun="onstart">
		if(startscene === null OR !scene[get(startscene)], copy(startscene,scene[0].name); );
		loadscene(get(startscene), null, MERGE);
		if(startactions !== null, startactions() );
	</action>
	


	<scene name="scene_achilleion-hof-unten" title="Achilleion - Garden" onstart="" thumburl="panos/achilleion-hof-unten.tiles/thumb.jpg" lat="39.563340" lng="19.904324" heading="0.0">

		<view hlookat="-1" vlookat="11" fovtype="MFOV" fov="120" fovmin="70" fovmax="140" limitview="auto" />

		<preview url="panos/achilleion-hof-unten.tiles/preview.jpg" />

		<image>
			<cube url="panos/achilleion-hof-unten.tiles/mobile_%s.jpg" if="browser.domain != 'krpano.com'" />
			<cube url="https://krpano.com/tours/corfu/panos/achilleion-hof-unten.tiles/%s/l%l/%v/l%l_%s_%v_%h.jpg" multires="512,768,1536,2816" if="browser.domain == 'krpano.com'" />
		</image>

	<!-- static example -->
	<combobox name="cbsettings" design="vtour" align="righttop" x="10" y="10" onchange="selectItemByName(0);">
		<item name="item0" caption="SETTINGS" />
		<item name="item1" caption="Drag Control"   	onclick="set(control.mouse,drag); set(control.touch,drag);" />
		<item name="item2" caption="Move Control"   	onclick="set(control.mouse,moveto); set(control.touch,moveto);" />
		<item name="item3" caption="Normal View"		onclick="cm_normal_view();" />
		<item name="item4" caption="Fisheye View"   	onclick="cm_fisheye_view();" />
		<item name="item5" caption="Stereographic View" onclick="cm_stereographic_view();" />
		<item name="item6" caption="Architectural View" onclick="cm_architectural_view();" />
		<item name="item7" caption="Pannini View"   	onclick="cm_pannini_view();" />
		<item name="item8" caption="Little Planet View" onclick="cm_littleplanet_view();" />
	</combobox>


	</scene>

	<scene name="scene_canaldemure5" title="Canal d´Amour 2"  onstart="set(layer[get(cb_N )].visible,false); set(layer[get(cb_N )].enable,false);"  thumburl="panos/canaldemure5.tiles/thumb.jpg" lat="39.796233694" lng="19.70181763" heading="0.0">

		<view hlookat="-118" vlookat="4" fovtype="MFOV" fov="132" fovmin="70" fovmax="140" limitview="auto" />

		<preview url="panos/canaldemure5.tiles/preview.jpg" />

		<image>
			<cube url="panos/canaldemure5.tiles/mobile_%s.jpg" if="browser.domain != 'krpano.com'" />
			<cube url="https://krpano.com/tours/corfu/panos/canaldemure5.tiles/%s/l%l/%v/l%l_%s_%v_%h.jpg" multires="512,768,1536,2816" if="browser.domain == 'krpano.com'" />
		</image>

	</scene>

	<scene name="scene_kalamaki-strand" title="Kalamaki Beach 2" onstart="" thumburl="panos/kalamaki-strand.tiles/thumb.jpg" lat="39.7989065" lng="19.8847845" heading="0.0">

		<view hlookat="18" vlookat="1" fovtype="MFOV" fov="120" fovmin="70" fovmax="140" limitview="auto" />

		<preview url="panos/kalamaki-strand.tiles/preview.jpg" />

		<image>
			<cube url="panos/kalamaki-strand.tiles/mobile_%s.jpg" if="browser.domain != 'krpano.com'" />
			<cube url="https://krpano.com/tours/corfu/panos/kalamaki-strand.tiles/%s/l%l/%v/l%l_%s_%v_%h.jpg" multires="512,1152,2176" if="browser.domain == 'krpano.com'" />
		</image>

	</scene>

</krpano>

This post has been edited 1 times, last edit by "Islander" (Oct 21st 2019, 7:27pm)


7

Monday, October 21st 2019, 7:52pm

plugins/combobox.xml line 78 - add attribute onloaded="set(cb_N,get(name));"

8

Tuesday, October 22nd 2019, 6:18am

The problem is still here. All layers disappear in the 2nd scene.

9

Tuesday, October 22nd 2019, 9:07am

Everything works fine, look for a syntax error in yourself.
Here are the working files
San7 has attached the following files:
  • combobox.xml (20.44 kB - 3 times downloaded - latest: Nov 4th 2019, 10:34am)
  • tour.xml (3.43 kB - 2 times downloaded - latest: Nov 4th 2019, 10:34am)

10

Tuesday, October 22nd 2019, 7:59pm

Hi San,
It's effectively working well.
I missed to place this code for every scene with "true" set for the scene where the combo box should appear : onstart="set(layer[get(cb_N )].visible,false); set(layer[get(cb_N )].enable,false);"
Thanks a lot for your good help. I guess this will come to be used by many of us.