My favorites | Sign in
Project Home Downloads Wiki Issues Source
Checkout   Browse   Changes    
 
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
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Panel title="Google Maps Attitude Demo" width="100%" height="100%">
<mx:VBox width="100%" height="100%">
<mx:HBox width="100%" height="25">
<mx:Label
text="Yaw: "/>
<mx:TextInput
id="yaw"
text="20"
dropShadowColor="0x000000"
/>
<mx:Button
id="yawButton" label="Set Yaw"
click="changeYaw(yaw.text);"
/>
<mx:Label
text="Pitch: "/>
<mx:TextInput
id="pitch"
text="0"
dropShadowColor="0x000000"
/>
<mx:Button
id="pitchButton" label="Set Pitch"
click="changePitch(pitch.text);"
/>
</mx:HBox>
<maps:Map3D xmlns:maps="com.google.maps.*"
mapevent_mappreinitialize="onMapPreinitialize(event)"
mapevent_mapready="onMapReady(event)"
id="map"
sensor="false" key="your_api_key"
width="100%" height="100%" />
</mx:VBox>
</mx:Panel>
<mx:Script>
<![CDATA[
import com.google.maps.LatLng;
import com.google.maps.Map3D;
import com.google.maps.MapEvent;
import com.google.maps.MapMouseEvent;
import com.google.maps.MapOptions;
import com.google.maps.MapType;
import com.google.maps.View;
import com.google.maps.controls.NavigationControl;
import com.google.maps.geom.Attitude;

private function onMapPreinitialize(event:MapEvent):void {
var myMapOptions:MapOptions = new MapOptions;
myMapOptions.zoom = 12;
myMapOptions.center = new LatLng(40.756054, -73.986951);
myMapOptions.mapType = MapType.PHYSICAL_MAP_TYPE;
myMapOptions.viewMode = View.VIEWMODE_PERSPECTIVE;
myMapOptions.attitude = new Attitude(0,0,0);
this.map.setInitOptions(myMapOptions);
}

private function onMapReady(event:MapEvent):void {
this.map.addControl(new NavigationControl());
}

private function changeYaw(yaw:String):void {
map.setAttitude(new Attitude(Number(yaw),map.getAttitude().pitch,0));
}

private function changePitch(pitch:String):void {
this.map.setAttitude(new Attitude(map.getAttitude().yaw,Number(pitch),0));
}
]]>
</mx:Script>
</mx:Application>

Change log

r341 by t...@google.com on Sep 21, 2010   Diff
Update the code samples to not include a
valid API key
Go to: 
Project members, sign in to write a code review

Older revisions

r340 by t...@google.com on Sep 21, 2010   Diff
Add sensor parameter to code samples
r324 by manshreck on Jul 28, 2009   Diff
Added 3D Map Attitude example

All revisions of this file

File info

Size: 2053 bytes, 72 lines

File properties

svn:executable
*
Powered by Google Project Hosting