You are not logged in.

jschrader

Intermediate

  • "jschrader" started this thread

Posts: 237

Location: Bavaria, Germany

Occupation: Photographer, Producer

  • Send private message

1

Thursday, April 11th 2013, 3:55pm

Need urgent help with a layer/action/ios issue

Please have a look and let me know what could be the cuase or a solution.

I have a tour with a simple map and I want the map to close at the start of the tour.
I used the onloaded="closemap()" which works on desktop but on the iPad the map stays opened.

The code is placed outside the scenes.


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
		<!-- the image map -->
	<layer name="map1" url="skin/karte.png" keep="true" align="left" x="-5" y="-80" width="350" height="470" 
		altonloaded="if(istablet, mul(scale,1.0));"
	        handcursor="false"
	        scalechildren="true"
	        maskchildren="true"
	        onclick="closemap()"
		onloaded="closemap()"
		border="10"
			
	>
		
		<!-- 'rooms' and spots - the 'room' container elements were used for masking the radar -->

		
		<layer name="spot1" style="map_hotspotstyle" x="61" y="249" onclick="loadscene(scene_01_koeln, null, MERGE, BLEND(1));" />
		
			<layer name="spot2" style="map_hotspotstyle" x="75" y="227" onclick="loadscene(scene_02_dortmund, null, MERGE, BLEND(1));" />
		
			<layer name="spot3" style="map_hotspotstyle" x="154" y="119" onclick="loadscene(scene_03_hamburg, null, MERGE, BLEND(1));" />
		
			<layer name="spot4" style="map_hotspotstyle" x="214" y="383" onclick="loadscene(scene_04_muenchen, null, MERGE, BLEND(1));" />
	
			<layer name="spot5" style="map_hotspotstyle" x="200" y="314" onclick="loadscene(scene_05_nuernberg, null, MERGE, BLEND(1));" />
	
			
	
	</layer>
	
	

		<!-- radar plugin, will be assigned to be a child of spot -->
	<layer name="activespot" scale="1.0" keep="true" visible="false" altonloaded="if(istablet, mul(scale,1.2));"
	       url="skin/mappointactive.png"
	       align="center" edge="center"
	       
	       />

	<!-- actions -->
	<action name="closemap">
        set(onclick, openmap() );
        tween(x,-325);
    </action>

    <action name="openmap">
        set(onclick, closemap() );
        tween(x,-5);
    </action>

	<!-- activatespot action - %1 = the current spot, %2 = the current radar heading -->
	<action name="activatespot">
	
		set(layer[activespot].parent, layer[%1]);
		set(layer[activespot].visible, true);
		

	</action>


Thank you!

Oh, and another question, not so important, but how do I trigger the closemap action for this map for example with another plugin or hotspot?
When I simple use onclick="closemap();" the plugin will perform the sliding action itself.

Umalo

Professional

Posts: 1,051

Location: Osijek, Croatia, EU

  • Send private message

2

Thursday, April 11th 2013, 4:48pm

Change action from:

Source code

1
2
3
 <action name="closemap">
        set(onclick, openmap() );
        tween(x,-325);</action>...

to:

Source code

1
2
3
4
5
6
7
<action name="closemap">
        set(layer[map1].onclick, openmap() );
        tween(layer[map1].x,-325);</action>
    <action name="openmap">
        set(layer[map1].onclick, closemap() );
        tween(layer[map1].x,-5);
    </action>

jschrader

Intermediate

  • "jschrader" started this thread

Posts: 237

Location: Bavaria, Germany

Occupation: Photographer, Producer

  • Send private message

3

Thursday, April 11th 2013, 4:58pm

Wonderful, thank you!

4

Thursday, April 11th 2013, 6:20pm

Hi,
I used the onloaded="closemap()" which works on desktop but on the iPad the map stays opened.

I think the problem here is the 'altonloaded' - there is no closemap() call there as in the normal onloaded event:

Source code

1
altonloaded="if(istablet, mul(scale,1.0));"


try this instead:

Source code

1
altonloaded="if(istablet, mul(scale,1.0)); closemap()"


Best regards,
Klaus

jschrader

Intermediate

  • "jschrader" started this thread

Posts: 237

Location: Bavaria, Germany

Occupation: Photographer, Producer

  • Send private message

5

Thursday, April 11th 2013, 8:49pm

Klaus is right. As always ;-)

But

Source code

1
2
set(layer[map1].onclick, openmap() );
tween(layer[map1].x,-325);

is a solution to my second question if used from other places to trigger actions for the layer.