Flex calls GP and map editor example

Recommended for you: Get network issues from WhatsUp Gold. Not end users.

1, Release and the calling code GP model

2, <?xml version="1.0"encoding="utf-8"?>

3, <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

4, xmlns:esri="http://www.esri.com/2008/ags"

5, xmlns:s="library://ns.adobe.com/flex/spark"

6, pageTitle="China Country GDP and Popu">

7,

8, <fx:Script>

9, <![CDATA[

10, import com.esri.ags.FeatureSet;

11, import com.esri.ags.Graphic;

12, import com.esri.ags.events.GeoprocessorEvent;

13, import com.esri.ags.events.MapMouseEvent;

14, import com.esri.ags.events.QueryEvent;

15, import com.esri.ags.geometry.MapPoint;

16, import com.esri.ags.symbols.SimpleFillSymbol;

17, import com.esri.ags.symbols.SimpleLineSymbol;

18, import com.esri.ags.symbols.SimpleMarkerSymbol;

19, import com.esri.ags.tasks.supportClasses.LinearUnit;

20, import com.esri.ags.tasks.supportClasses.ParameterValue;

21,

22, import mx.controls.Alert;

23, import mx.rpc.events.FaultEvent;

24,

25, privatevar myViewshedDistance:LinearUnit =new LinearUnit();

26,

27, privatefunction doViewshedGP(event:MapMouseEvent):void

28, {

29, myGraphicsLayer.clear();

30,

31,

32, var myMapPoint:MapPoint = event.mapPoint;

33, var graphic:Graphic =newGraphic(myMapPoint,null);

34, myGraphicsLayer.add(graphic);

35,

36, //The constructed data set (GP services only accept data set parameters)

37, var myFeatureSet:FeatureSet =new FeatureSet([ { geometry: myMapPoint } ]);

38,

39, //The length of class defined in AgsFlexApi from the reference view;[LinearUnit]

40,

41,

42, myViewshedDistance.distance= 10;

43, //myViewshedDistance.distance =Number(txtlength.text);

44, myViewshedDistance.units= "esriMiles";

45, //myViewshedDistance.units = drop.selectedItem;

46,

47, //To the parameters for the GP service

48, var params:Object = {

49, <

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Selma at December 24, 2013 - 8:38 AM