parameters.Add(new GPFeatureRecordSetLayer("Draw_Polygon", args.Geometry));
parameters.Add(new GPFeatureRecordSetLayer("Draw_Polygon", new FeatureSet( (Map.Layers["MyGraphicsLayer"] as GraphicsLayer).Graphics )));
private void CreateGeoPoly_Click(object sender, RoutedEventArgs e) { //Gives users ability to draw poly MyDrawObject = new Draw(Map) { DrawMode = DrawMode.Polygon, IsEnabled = true, FillSymbol = LayoutRoot.Resources["ClipFeaturesFillSymbol"] as ESRI.ArcGIS.Client.Symbols.FillSymbol }; //Start MyDrawObject_DrawComplete, which turns the drawn poly into a graphic MyDrawObject.DrawComplete += MyDrawObject_DrawComplete; }
private void MyDrawObject_DrawComplete(object sender, DrawEventArgs args) { //Disable the drawing tool MyDrawObject.IsEnabled = false; //Start processing time bar ProcessingTextBlock.Visibility = Visibility.Visible; _processingTimer.Start(); //Assign the graphic draw to a graphiclayer, the graphic layer is defined in xaml GraphicsLayer graphicsLayer = Map.Layers["MyGraphicsLayer"] as GraphicsLayer; //Ready the graphic to assign the graphic to the parameter Graphic graphic = new Graphic() { Symbol = LayoutRoot.Resources["ClipFeaturesFillSymbol"] as ESRI.ArcGIS.Client.Symbols.FillSymbol, Geometry = args.Geometry }; //add graphic graphicsLayer.Graphics.Add(graphic); }
If your number of input geometry is not defined you can also consider to use a FeatureSetLayer as input.
private void RunGeoPolyButton_Click(object sender, RoutedEventArgs e) { //Declare GP Task and URL Geoprocessor geoprocessorTask = new Geoprocessor("http://servername/ArcGIS/rest/services/GPServer/CreatePoly"); geoprocessorTask.UpdateDelay = 5000; //When Task Completes call method GeoprocessorTask_JobCompleted geoprocessorTask.JobCompleted += GeoprocessorTask_JobCompleted; //Input Parameters List<GPParameter> parameters = new List<GPParameter>(); parameters.Add(new GPFeatureRecordSetLayer("Draw_Polygon", args.Geometry)); geoprocessorTask.SubmitJobAsync(parameters);
all the tasks seem to be kicking off by using the DrawEventArgs args complete call.
I was wondering can the tasks take more than one input ...more than one poly,line, or point?
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.