private void ExtractButton_Click(object sender, RoutedEventArgs e) { if (clipByExtent) { GraphicCollection clipGraphics = new GraphicCollection(); clipGraphics.Add(new Graphic() { Geometry = GeometryTool.EnvelopeToPolygon(this.MapControl.Extent) }); CreateGPParamsAndExtract(clipGraphics); } else { if (needGeneralized) { GeneralizeParameters genParam = new GeneralizeParameters() { DeviationUnit = LinearUnit.Meter, MaxDeviation = 10 }; geometryService.GeneralizeAsync(this.GraphicsLayer.Graphics, genParam); } else { CreateGPParamsAndExtract(this.GraphicsLayer.Graphics); } } }
private void GeneralizeButton_Click(object sender, RoutedEventArgs e) { GeneralizeButton.IsEnabled = false; SliderStackPanel.Visibility = Visibility.Collapsed; GraphicsLayer originalGraphicsLayer = MyMap.Layers["OriginalLineGraphicsLayer"] as GraphicsLayer; GeometryService geometryService = new GeometryService("http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer"); geometryService.GeneralizeCompleted += GeometryService_GeneralizeCompleted; geometryService.Failed += GeometryService_Failed; GeneralizeParameters generalizeParameters = new GeneralizeParameters() { DeviationUnit = LinearUnit.SurveyMile, MaxDeviation = 0.000001 }; geometryService.GeneralizeAsync(new List<Graphic>() { originalGraphicsLayer.Graphics[0] }, generalizeParameters); }
private void GeneralizeButton_Click(object sender, RoutedEventArgs e) { GeneralizeButton.IsEnabled = false; SliderStackPanel.Visibility = Visibility.Collapsed; GraphicsLayer originalGraphicsLayer = MyMap.Layers["OriginalLineGraphicsLayer"] as GraphicsLayer; GeometryService geometryService = new GeometryService("http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer"); geometryService.GeneralizeCompleted += GeometryService_GeneralizeCompleted; geometryService.Failed += GeometryService_Failed; GeneralizeParameters generalizeParameters = new GeneralizeParameters() { DeviationUnit = LinearUnit.SurveyMile, MaxDeviation = 0.000001 }; geometryService.GeneralizeAsync(new List <Graphic>() { originalGraphicsLayer.Graphics[0] }, generalizeParameters); }