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

Friday, March 20th 2020, 4:49pm

Radar plugin positioning on map

Hi everyone!

Total newby without any coding experience whatsoever here!

I have a tour with 4 panos and 4 spots positioned in a map representing the position of each pano.


I have gotten the radar plugin to work, but for the life of me can not get the radar to change position to the pano you are currently viewing.

If someone could point me in the correct direction I would be immensely grateful!


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
<!-- activated spot image (child of the radar layer) -->
<layer name="activespot" url="" align="bottomleft" scale="0.5" edge="center" ox="0" oy="0" zorder="3" visible="true" />

<!-- activated spot image (child of the radar layer) -->
<layer name="activespot" url="" align="lefttop" scale="0.5" edge="center" ox="0" oy="0" zorder="3" visible="true" />





	<!-- radar plugin, set heading with "plugin[radar].heading" -->
	<plugin name="radar" 
	      
	    	url="%SWFPATH%/plugins/radar.swf"
			alturl="./plugins/radar.js"
	    	zorder="2"
	    	keep="true"
	    	heading="0"
	    	parent="map"
	    	mask="skin/map_mask"
			maskchildren="false"
	    	align="bottomleft"
	    	edge="center"
	    	x="150" y="200"
	    	linecolor="1"
	    	fillcolor="0xFF4A1C"
	    	scale="0.8"
	    	visible="true"
			enabled="false"
	    	/>

<layer name="radar" url="" align="lefttop" scale="0.5" edge="center" ox="0" oy="0" zorder="2" visible="true" />

<!-- activated spot image (child of the radar layer) -->
<layer name="activespot" url="" align="lefttop" scale="0.5" edge="center" ox="0" oy="0" zorder="3" visible="true" />



<!-- activatespot action - %1 = the current spot, %2 = the current radar heading -->
<action name="activatespot">
<!-- copy the spot position to the radar and activespot position -->
copy(layer[radar].4, layer[%1].15);
copy(layer[radar].y, layer[%1].y);
copy(layer[activespot].x, layer[%1].x);
copy(layer[activespot].y, layer[%1].y);

<!-- set the radar heading -->
set(layer[radar].heading, %2);

<!-- show the radar and the activespot -->
set(layer[radar].visible, true);
set(layer[activespot].visible, true);
</action>

			
</krpano>


This is what I have in my .xml at the moment.

Thank you very much!

servaas

Intermediate

Posts: 215

Location: Belgium

  • Send private message

2

Friday, March 20th 2020, 5:40pm

I'm far from an expert, but this is what I found in my 'old' code.

Source code

1
2
3
4
5
6
7
8
<!-- 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);
		);


and the heading setting

Source code

1
<spot name="scene_kitchen" x="255" y="285" heading="90" />"


Maybe it might help.
S

Similar threads