PageRenderTime 27ms CodeModel.GetById 21ms app.highlight 1ms RepoModel.GetById 2ms app.codeStats 0ms

/examples/ArcGISLink/src/SimpleAdd.mxml

http://gmaps-utility-library-flash.googlecode.com/
Macromedia eXtensible Markup Language | 49 lines | 43 code | 6 blank | 0 comment | 0 complexity | c932a0aef39b59efebc216737fe39a01 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%" viewSourceURL="srcview/index.html">
 6  <mx:Panel title="Simple Add ArcGIS Maps"
 7            width="100%"
 8            height="100%">
 9    <maps:Map xmlns:maps="com.google.maps.*"
10              id="map"
11              mapevent_mapready="onMapReady(event)"
12              width="100%"
13              height="100%" sensor="false"
14              key="ABQIAAAA7QUChpcnvnmXxsjC7s1fCxQGj0PqsCtxKvarsoS-iqLdqZSKfxTd7Xf-2rEc_PC9o8IsJde80Wnj4g"/>
15
16  </mx:Panel>
17
18  <mx:Script>
19    <![CDATA[
20      import com.google.maps.controls.NavigationControl;
21      import com.google.maps.controls.MapTypeControl;
22
23      import com.google.maps.LatLng;
24      import com.google.maps.Map;
25      import com.google.maps.MapEvent;
26      import com.google.maps.MapType;
27      import com.google.maps.MapOptions;
28      import com.google.maps.interfaces.*;
29
30      import com.google.maps.extras.arcgislink.*;
31
32
33      private function onMapReady(event:Event):void {
34        map.setCenter(new LatLng(45.5, -122.7), 14);
35        map.addControl(new com.google.maps.controls.MapTypeControl());
36        map.addControl(new NavigationControl());
37        map.enableScrollWheelZoom();
38        map.enableContinuousZoom();
39        var base:String='http://sampleserver1.arcgisonline.com/ArcGIS/rest/services';
40        var tiled:String='http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer';
41        var dyna:String=base + '/Demographics/ESRI_Census_USA/MapServer';
42        ArcGISUtil.addArcGISMap(map, tiled, function(res:ArcGISMapType):void{
43          map.setMapType(res);
44        });
45        ArcGISUtil.addArcGISMap(map, dyna);
46      }
47    ]]>
48  </mx:Script>
49</mx:Application>