刚试了下谷歌地图,效果确实不错,呵呵,其他高级功能没看API,上图(PS:代码超级简单,大家看下就会使用了)
代码如下:
import com.google.maps.LatLng;
import com.google.maps.Map;
import com.google.maps.MapEvent;
import com.google.maps.MapType;
var map:Map = new Map();
map.key = "your_api_key";
map.setSize (new Point(stage.stageWidth, stage.stageHeight));
map.addEventListener (MapEvent.MAP_READY, onMapReady);
this.addChild (map);
function onMapReady (event:Event):void {
map.setCenter (new LatLng(40.736072,-73.992062), 14,
MapType.NORMAL_MAP_TYPE);
}
如果要使用网页加载SWF
使用下面的代码(注意 flashVars="key=your_api_key"
要填入您申请的kEY)
<div id="map_canvas"
name="map_canvas">
<object
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"
width="800px"
height="600px">
<param name="movie"
value="MapSimple.swf">
<param name="quality"
value="high">
<param name="flashVars"
value="key=your_api_key">
<embed
width="800px"
height="600px"
src="MapSimple.swf"
quality="high"
flashVars="key=your_api_key"
pluginspage="http://www.macromedia.com/go/getflashplayer"
type="application/x-shockwave-flash">
</embed>
</object>
</div>