/examples/ArcGISLink/src/ArcGISOnline.mxml
Macromedia eXtensible Markup Language | 59 lines | 51 code | 8 blank | 0 comment | 0 complexity | c96cb51e60d76b94af5ae17d5c01dd78 MD5 | raw file
- <?xml version="1.0" encoding="utf-8"?>
- <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
- layout="absolute"
- width="100%"
- height="100%">
- <mx:Panel title="ArcGIS Online Maps. Check License restrictions at www.arcgisonline.com to use in production systems."
- width="100%"
- height="100%">
- <maps:Map xmlns:maps="com.google.maps.*"
- id="map"
- mapevent_mappreinitialize="onMapPreInitialize(event)"
- mapevent_mapready="onMapReady(event)"
- width="100%"
- height="100%"
- key="ABQIAAAA7QUChpcnvnmXxsjC7s1fCxQGj0PqsCtxKvarsoS-iqLdqZSKfxTd7Xf-2rEc_PC9o8IsJde80Wnj4g" sensor="false"/>
-
- </mx:Panel>
-
- <mx:Script>
- <![CDATA[
- //local: ABQIAAAA7QUChpcnvnmXxsjC7s1fCxQGj0PqsCtx KvarsoS-iqLdqZSKfxTd7Xf-2rEc_PC9o8IsJde80Wnj4g
- //util: ABQIAAAAGY8Xhrw1zw6Ia3dwUJVxKRT2yXp_ ZAY8_ufC3CFXhHIE1NvwkxQTxMd7f8tzuEeq7aWKejTn-XQrIA
- import com.google.maps.controls.NavigationControl;
- import com.google.maps.controls.MapTypeControl;
-
- import com.google.maps.LatLng;
- import com.google.maps.Map;
- import com.google.maps.MapEvent;
- import com.google.maps.MapType;
- import com.google.maps.MapOptions;
- import com.google.maps.interfaces.*;
-
- import com.google.maps.extras.arcgislink.*;
-
-
- private var base:String='http://services.arcgisonline.com/ArcGIS/rest/services';
-
- private function onMapPreInitialize(event:Event):void {
- var url:String=base + '/World_Topo_Map/MapServer';
- var agsType:ArcGISMapType=new ArcGISMapType(url, new ArcGISMapTypeOptions({projection: ArcGISTileConfig.GOOGLE_MAPS}));
- var opts:MapOptions=new MapOptions({mapTypes: [agsType], center: new LatLng(40, -95), zoom: 4});
- map.setInitOptions(opts);
- }
-
- private function onMapReady(event:Event):void {
- map.addControl(new com.google.maps.controls.MapTypeControl());
- map.addControl(new NavigationControl());
- map.enableScrollWheelZoom();
- map.enableContinuousZoom();
- ArcGISUtil.addArcGISMap(map, base + "/World_Street_Map/MapServer");
- ArcGISUtil.addArcGISMap(map, base + "/USA_Topo_Maps/MapServer");
- ArcGISUtil.addArcGISMap(map, base + "/World_Imagery/MapServer");
- ArcGISUtil.addArcGISMap(map, base + "/World_Physical_Map/MapServer");
- ArcGISUtil.addArcGISMap(map, base + "/World_Shaded_Relief/MapServer");
- ArcGISUtil.addArcGISMap(map, base + "/World_Terrain_Base/MapServer");
- }
- ]]>
- </mx:Script>
- </mx:Application>