2013年1月2日 星期三

Google Maps API(Flash 版)

Google Maps API(Flash 版)的“Hello World”

<?xml version="1.0" encoding="utf-8"?> 
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> 
<maps:Map xmlns:maps="com.google.maps.*" id="map" mapevent_mapready="onMapReady(event)"     width="100%" height="100%" key="your_api_key"/> 
<mx:Script>     
<![CDATA[          
    import com.google.maps.LatLng;     
    import com.google.maps.Map;     
    import com.google.maps.MapEvent;     
    import com.google.maps.MapType;       
    private function onMapReady(event:Event):void {       
    this.map.setCenter(new LatLng(40.736072,-73.992062), 14, MapType.NORMAL_MAP_TYPE);     
    }   
]]> 
</mx:Script> 
</mx:Application>
 

演示地址:http://gmaps-samples-flash.googlecode.com/svn/trunk/examples/HelloWorld.html
 

想更快了解更多Google Maps API(Flash 版)
http://code.google.com/intl/zh-CN/apis/maps/documentation/flash/intro.html

沒有留言:

張貼留言