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.

martyhr

Intermediate

  • "martyhr" started this thread

Posts: 350

Location: CZ

  • Send private message

1

Monday, December 17th 2012, 5:55pm

SOLVED-multiple radars and their headings

Hi, excuse my stupidity but I can not figure where I should add heading for each mapspots.
I play with the Klaus's example code and I can also find the right headings for each panorama using the radar.swf and its editmode="true".

But I have different heading values and I can not find the right place in the code to put it to each mapspot. I will have 3 floors and 31 mapspots in my project.
Thanks in advance

<?xml version="1.0" encoding="utf-8"?>
<krpano>
<!-- the image map -->
<layer name="prvnipatro" url="%SWFPATH%/skin/prvnipatro700.png" keep="true" align="topright" x="10" y="10" width="64" height="45" handcursor="true" scalechildren="true" maskchildren="true" onclick="openmap();">
<!-- 'rooms' and spots - the 'room' container elements were used for masking the radar -->

<layer name="mapspot1" url="%SWFPATH%/skin/mappoint.png" align="lefttop" edge="center" x="426" y="361" zorder="2" onhover="showtext(Vstupní terasa,DEFAULT);" onclick="loadscene(scene_01panocorr, null, MERGE, BLEND(1));" />


<layer name="mapspot2" url="%SWFPATH%/skin/mappoint.png" align="lefttop" edge="center" x="61" y="104" zorder="2" onclick="loadscene(scene_02panocorr, null, MERGE, BLEND(1));" />


<layer name="mapspot3" url="%SWFPATH%/skin/mappoint.png" align="lefttop" edge="center" x="92" y="46" zorder="2" onclick="loadscene(scene_03panocorr, null, MERGE, BLEND(1));" />

</layer>

<!-- radar plugin, will be assigned to be a child of spot -->
<layer name="radar" keep="true" visible="false" url="%SWFPATH%/plugins/radar.swf" alturl="%SWFPATH%/plugins/radar.js" align="center" edge="center" fillcolor="0x273233" fillalpha="0.4" scale="0.5" editmode="true" headingoffset="0" />
<!-- activated spot image (child of the radar layer) -->
<layer name="activespot" parent="radar" url="%SWFPATH%/skin/mappointactive.png" keep="true" align="center" edge="center" />
<!-- actions -->
<action name="closemap">
set(onclick, openmap() );
tween(width,64);
tween(height,45);
</action>
<action name="openmap">
set(onclick, closemap() );
tween(width,700);
tween(height,437);
</action>
<!-- activatespot action - %1 = the current spot, %2 = the current radar heading -->
<action name="activatespot">
set(layer[radar].parent, layer[%1]);
set(layer[radar].visible, true);
set(layer[radar].heading, %2);
</action>
</krpano>

This post has been edited 1 times, last edit by "martyhr" (Dec 17th 2012, 11:03pm)


martyhr

Intermediate

  • "martyhr" started this thread

Posts: 350

Location: CZ

  • Send private message

2

Monday, December 17th 2012, 11:03pm

SOLVED with a pain.

3

Friday, July 19th 2013, 10:00pm

SOLVED with a pain.
How? :)
I'm struggling with the same thing. :/

Alexey Tkachenko

Professional

Posts: 760

Location: Sevastopol, Crimea, Russian Federation

Occupation: Interpreting, Building virtual tours

  • Send private message

4

Friday, July 19th 2013, 11:51pm

Hi!

I guess you are talking about the image-map example in the download package.

Let's see...

There are three scenes in that example. Each of them has onstart(); action

Source code

1
onstart="activatespot(spot1, 0);


This action has two parametres: spot1 and 0. So when scene1 is loaded these parameters are passed to the action.

The action itself is:

Source code

1
2
3
4
5
<action name="activatespot">
		set(layer[radar].parent, layer[%1]);
		set(layer[radar].visible, true);
		set(layer[radar].heading, %2);
 </action>



Where %1 is parameter No.1 and %2 is parameter No.2. As we see from the onstart(); action of the first scene, these are spot1 and 0.

So for the first scene the action will run as follows:

Source code

1
2
3
4
5
<action name="activatespot">
 	set(layer[radar].parent, layer[spot1]);
		set(layer[radar].visible, true);
 	set(layer[radar].heading, 0);
	</action>


In other words, action sets layer "spot1" as parent for the radar, makes the radar visible and sets its heading to "0'.
In the second scene these two parameters are "spot2" and "90", so when it's loaded, these two values will be used in the action as %1 and %2.
To sum up... In each scene state onloaded="activatespot(your_mapspot_name,its_heading).
Hope this helps ;-)
Regards,

Alexey

5

Saturday, July 20th 2013, 12:16am


To sum up... In each scene state onloaded="activatespot(your_mapspot_name,its_heading).
Hope this helps ;-)
OMG it works, thank you so much *thumbsup*

i thought i need to put heading into <layer name="spot2" url="skin/mappoint.png" align="lefttop" heading="200" ... >
;)
thx again

Alexey Tkachenko

Professional

Posts: 760

Location: Sevastopol, Crimea, Russian Federation

Occupation: Interpreting, Building virtual tours

  • Send private message

6

Saturday, July 20th 2013, 10:24am

Hi!

I'm glad this helped. If it's more convenient to put headings inside the "mapspots" layers, then just use one parameter - the name of the mapspot layer.
So the action would be:

Source code

1
2
3
4
5
<action name="activatespot">
		set(layer[radar].parent, layer[%1]);
		set(layer[radar].visible, true);
set(layer[radar].heading, get(layer[%1].heading));
 </action>


and inside the mapspot layer indicate the heading the way you do it in your post:

Source code

1
<layer name="spot2" url="skin/mappoint.png" align="lefttop" heading="200" ... >
Regards,

Alexey