/examples/ArcGISLink/src/ArcGISOnline.mxml
Macromedia eXtensible Markup Language | 59 lines | 51 code | 8 blank | 0 comment | 0 complexity | c96cb51e60d76b94af5ae17d5c01dd78 MD5 | raw file
1<?xml version="1.0" encoding="utf-8"?> 2<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" 3 layout="absolute" 4 width="100%" 5 height="100%"> 6 <mx:Panel title="ArcGIS Online Maps. Check License restrictions at www.arcgisonline.com to use in production systems." 7 width="100%" 8 height="100%"> 9 <maps:Map xmlns:maps="com.google.maps.*" 10 id="map" 11 mapevent_mappreinitialize="onMapPreInitialize(event)" 12 mapevent_mapready="onMapReady(event)" 13 width="100%" 14 height="100%" 15 key="ABQIAAAA7QUChpcnvnmXxsjC7s1fCxQGj0PqsCtxKvarsoS-iqLdqZSKfxTd7Xf-2rEc_PC9o8IsJde80Wnj4g" sensor="false"/> 16 17 </mx:Panel> 18 19 <mx:Script> 20 <![CDATA[ 21 //local: ABQIAAAA7QUChpcnvnmXxsjC7s1fCxQGj0PqsCtx KvarsoS-iqLdqZSKfxTd7Xf-2rEc_PC9o8IsJde80Wnj4g 22 //util: ABQIAAAAGY8Xhrw1zw6Ia3dwUJVxKRT2yXp_ ZAY8_ufC3CFXhHIE1NvwkxQTxMd7f8tzuEeq7aWKejTn-XQrIA 23 import com.google.maps.controls.NavigationControl; 24 import com.google.maps.controls.MapTypeControl; 25 26 import com.google.maps.LatLng; 27 import com.google.maps.Map; 28 import com.google.maps.MapEvent; 29 import com.google.maps.MapType; 30 import com.google.maps.MapOptions; 31 import com.google.maps.interfaces.*; 32 33 import com.google.maps.extras.arcgislink.*; 34 35 36 private var base:String='http://services.arcgisonline.com/ArcGIS/rest/services'; 37 38 private function onMapPreInitialize(event:Event):void { 39 var url:String=base + '/World_Topo_Map/MapServer'; 40 var agsType:ArcGISMapType=new ArcGISMapType(url, new ArcGISMapTypeOptions({projection: ArcGISTileConfig.GOOGLE_MAPS})); 41 var opts:MapOptions=new MapOptions({mapTypes: [agsType], center: new LatLng(40, -95), zoom: 4}); 42 map.setInitOptions(opts); 43 } 44 45 private function onMapReady(event:Event):void { 46 map.addControl(new com.google.maps.controls.MapTypeControl()); 47 map.addControl(new NavigationControl()); 48 map.enableScrollWheelZoom(); 49 map.enableContinuousZoom(); 50 ArcGISUtil.addArcGISMap(map, base + "/World_Street_Map/MapServer"); 51 ArcGISUtil.addArcGISMap(map, base + "/USA_Topo_Maps/MapServer"); 52 ArcGISUtil.addArcGISMap(map, base + "/World_Imagery/MapServer"); 53 ArcGISUtil.addArcGISMap(map, base + "/World_Physical_Map/MapServer"); 54 ArcGISUtil.addArcGISMap(map, base + "/World_Shaded_Relief/MapServer"); 55 ArcGISUtil.addArcGISMap(map, base + "/World_Terrain_Base/MapServer"); 56 } 57 ]]> 58 </mx:Script> 59</mx:Application>