My favorites | Sign in
Project Logo
                
Changes to /trunk/samplecode/MapSimple.mxml
r0 vs. r8   Edit
  Compare: vs.   Format:
Revision r8
Go to: 
Project members, sign in to write a code review
/trunk/samplecode/MapSimple.mxml /trunk/samplecode/MapSimple.mxml   r8
  1 <?xml version="1.0" encoding="utf-8"?>
  2 <!-- Copyright 2007 Google Inc. -->
  3 <!-- All Rights Reserved. -->
  4 <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="100%" height="100%">
  5 <mx:Panel title="Google Maps API for Flash - Simple Map" width="100%" height="100%">
  6 <mx:UIComponent id="mapContainer"
  7 initialize="startMap(event);"
  8 resize="resizeMap(event)"
  9 width="100%" height="100%"/>
  10 </mx:Panel>
  11 <mx:Script>
  12 <![CDATA[
  13 import flash.events.Event;
  14 import com.google.maps.MapEvent;
  15 import com.google.maps.Map;
  16 import com.google.maps.MapType;
  17 import com.google.maps.LatLng;
  18
  19 private var map:Map;
  20
  21 public function startMap(event:Event):void {
  22 map = new Map();
  23 map.addEventListener(MapEvent.MAP_READY, onMapReady);
  24 mapContainer.addChild(map);
  25 }
  26
  27 public function resizeMap(event:Event):void {
  28 map.setSize(new Point(mapContainer.width, mapContainer.height));
  29 }
  30
  31 private function onMapReady(event:Event):void {
  32 map.setCenter(new LatLng(40.736072,-73.992062), 14, MapType.NORMAL_MAP_TYPE);
  33 }
  34 ]]>
  35 </mx:Script>
  36 </mx:Application>
Hosted by Google Code