What's new?
|
Help
|
Directory
|
Sign in
gmaps-samples-flash
Sample code for the Google Maps API for Flash
Project Home
Downloads
Wiki
Issues
Source
Checkout
|
Browse
|
Changes
|
Source Path:
svn
/
trunk
/
samplecode
/
MapSimple.mxml
r121
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
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2007 Google Inc. -->
<!-- All Rights Reserved. -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="100%" height="100%">
<mx:Panel title="Google Maps API for Flash - Simple Map" width="100%" height="100%">
<mx:UIComponent id="mapContainer"
initialize="startMap(event);"
resize="resizeMap(event)"
width="100%" height="100%"/>
</mx:Panel>
<mx:Script>
<![CDATA[
import flash.events.Event;
import com.google.maps.MapEvent;
import com.google.maps.Map;
import com.google.maps.MapType;
import com.google.maps.LatLng;
private var map:Map;
public function startMap(event:Event):void {
map = new Map();
map.addEventListener(MapEvent.MAP_READY, onMapReady);
mapContainer.addChild(map);
}
public function resizeMap(event:Event):void {
map.setSize(new Point(mapContainer.width, mapContainer.height));
}
private function onMapReady(event:Event):void {
map.setCenter(new LatLng(40.736072,-73.992062), 14, MapType.NORMAL_MAP_TYPE);
}
]]>
</mx:Script>
</mx:Application>
Show details
Hide details
Change log
r8
by pamela.fox on May 13, 2008
Diff
Adding MapSimple example
Go to:
/trunk/examples/MapSimple.html
/trunk/examples/swf/MapSimple.swf
/trunk/samplecode/MapSimple.mxml
...e/maps/examples/TextualZoomControl.as
Project members,
sign in
to write a code review
Older revisions
All revisions of this file
File info
Size: 1134 bytes, 36 lines
View raw file