private void DensifyButton_Click(object sender, RoutedEventArgs e)
        {
            DensifyButton.IsEnabled = false;

            GraphicsLayer graphicsLayerPolygon = MyMap.Layers["PolygonGraphicsLayer"] as GraphicsLayer;

            GeometryService geometryService =
                        new GeometryService("http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer");
            geometryService.DensifyCompleted += GeometryService_DensifyCompleted;
            geometryService.Failed += GeometryService_Failed;

            DensifyParameters densityParameters = new DensifyParameters()
            {
                LengthUnit = LinearUnit.Meter,
                Geodesic = true,
                MaxSegmentLength = MyMap.Resolution * 10
            };

            geometryService.DensifyAsync(graphicsLayerPolygon.Graphics.ToList(), densityParameters);
        }
Пример #2
0
        private void DensifyButton_Click(object sender, RoutedEventArgs e)
        {
            DensifyButton.IsEnabled = false;

            GraphicsLayer graphicsLayerPolygon = MyMap.Layers["PolygonGraphicsLayer"] as GraphicsLayer;

            GeometryService geometryService =
                new GeometryService("http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer");

            geometryService.DensifyCompleted += GeometryService_DensifyCompleted;
            geometryService.Failed           += GeometryService_Failed;

            DensifyParameters densityParameters = new DensifyParameters()
            {
                LengthUnit       = LinearUnit.SurveyMile,
                Geodesic         = true,
                MaxSegmentLength = MyMap.Resolution * 1000
            };

            geometryService.DensifyAsync(graphicsLayerPolygon.Graphics.ToList(), densityParameters);
        }