google api

google api
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:maps="com.google.maps.*">
    <mx:Canvas x="44" y="73" width="200" height="200" backgroundColor="0xf7eeef">
    </mx:Canvas>

<mx:Script>
    <![CDATA[
        import com.google.maps.*;
        import com.google.maps.controls.*;
       
        private function onMapReady(event:MapEvent):void {      
    //设置地图显示的坐标,以及地图显示的类型.
    //MapType有4种类型分别是
    //HYBRID_MAP_TYPE 混合模式,
    //NORMAL_MAP_TYPE 标准模式,
    //PHYSICAL_MAP_TYPE自然地图模式,
    //SATELLITE_MAP_TYPE卫星模式
        this.map.setCenter(
        new LatLng(31.0729,121.49)/*经纬度*/,
        16,  MapType.NORMAL_MAP_TYPE);  
        var zoomctrl:ZoomControl = new ZoomControl();
       
        map.addControl( zoomctrl);
        map.addControl(new PositionControl());
        map.addControl(new MapTypeControl());
        //zoomctrl.setControlPosition(
}

    ]]>
</mx:Script>

<maps:Map xmlns:maps="com.google.maps.*"
    id="map" mapevent_mapready="onMapReady(event)"
    width="600" height="600"  
    key="ABQIAAAAEUQL_IqwWX4ZOcEtw0r7whRi_j0U6kJrkFvY4-OX2XYmEAa76BQc0gZPMJROw3owe9BMoRHM0FER_A"
/>
   

</mx:Application>


你可能感兴趣的:(google api)