<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:gm="com.google.maps.*"
backgroundGradientColors="[0xFFFFFF, 0xAAAAAA]"
height="100%" width="100%" viewSourceURL="srcview/index.html">
<gm:Map id="map"
width="100%"
height="100%"
key="(Your API Key Here)"
mapevent_mapready="map_mapReady(event)" />
<mx:Script>
<![CDATA[
import com.ags.tools.TileLayer;
import com.google.maps.LatLng;
import com.google.maps.Map;
import com.google.maps.MapType;
import com.google.maps.controls.MapTypeControl;
import com.google.maps.controls.OverviewMapControl;
import com.google.maps.controls.PositionControl;
import com.google.maps.controls.ScaleControl;
import com.google.maps.controls.ZoomControl;
import com.google.maps.interfaces.IMapType;
import com.google.maps.overlays.TileLayerOverlay;
private function map_mapReady(event:Event):void {
var baseUrl:String = "http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Portland/ESRI_LandBase_WebMercator/MapServer";
var copyright:String = "Taxlots, Zoning © Oregon METRO RLIS; Buildings © City of Portland Planning";
var tileLayer:TileLayer = new TileLayer(baseUrl, 0, 19, copyright);
var mapType:IMapType = new MapType([tileLayer], map.MERCATOR_PROJECTION, "Land Base");
map.addMapType(mapType);
var mtc:MapTypeControl = new MapTypeControl();
map.addControl(mtc);
var pc:PositionControl = new PositionControl();
map.addControl(pc);
var zc:ZoomControl = new ZoomControl();
map.addControl(zc);
var sc:ScaleControl = new ScaleControl();
map.addControl(sc);
var omc:OverviewMapControl = new OverviewMapControl();
map.addControl(omc);
map.setCenter(new LatLng(45.520211, -122.65553), 17, mapType);
}
]]>
</mx:Script>
</mx:Application>