${IS6_MeasureService_Title}

${IS6_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/IS/AjaxDemo");
            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/IS/AjaxDemo");
            measureRegion.ProcessAsync(parameters);
            measureRegion.ProcessCompleted += new EventHandler<MeasureEventArgs>(measureRegion_ProcessCompleted);
            measureRegion.Failed += new EventHandler<ServiceFailedEventArgs>(measure_Failed);
        }