${iServer2_measure_MeasureService_Title}

${iServer2_measure_MeasureService_Description}

Inheritance: SuperMap.Web.Service.ServiceBase
        //距离量算
        private void line_DrawCompleted(object sender, DrawEventArgs e)
        {
            //将线标绘在客户端要素图层
            PredefinedLineStyle lineStyle = new PredefinedLineStyle { Stroke = new SolidColorBrush(Colors.Red), StrokeThickness = 3 };
            Feature feature = new Feature
                {
                    Geometry = e.Geometry,
                    Style = lineStyle
                };
            featuresLayer.Features.Add(feature);

            MeasureParameters parameters = new MeasureParameters
            {
                Geometry = e.Geometry,
                MapName = "Changchun"
            };
            MeasureService measureDistance = new MeasureService("http://localhost:7080/demo/");
            measureDistance.ProcessAsync(parameters);
            measureDistance.ProcessCompleted += new EventHandler<MeasureEventArgs>(measureDistance_ProcessCompleted);
            measureDistance.Failed += new EventHandler<ServiceFailedEventArgs>(measure_Failed);
        }
        //面积量算
        private void polygon_DrawCompleted(object sender, DrawEventArgs e)
        {
            //将面标绘在客户端任意图层
            PolygonElement polygon = e.Element as PolygonElement;
            polygon.Opacity = 0.618;
            polygon.StrokeThickness = 1;
            polygon.Fill = new SolidColorBrush(Colors.LightGray);
            this.elementsLayer.Children.Add(polygon);

            MeasureParameters parameters = new MeasureParameters
            {
                Geometry = e.Geometry,
                MapName = "Changchun"
            };

            //与服务器交互
            MeasureService measureRegion = new MeasureService("http://localhost:7080/demo/");
            measureRegion.ProcessAsync(parameters);
            measureRegion.ProcessCompleted += new EventHandler<MeasureEventArgs>(measureRegion_ProcessCompleted);
            measureRegion.Failed += new EventHandler<ServiceFailedEventArgs>(measure_Failed);
        }