SuperMap.WinRT.Actions.DrawPolygon.Activate C# (CSharp) Method

Activate() private method

private Activate ( Point2D firstPoint ) : void
firstPoint SuperMap.WinRT.Core.Point2D
return void
        private void Activate(Point2D firstPoint)
        {
            if (Map == null || Map.Layers == null)
            {
                return;
            }

            DrawLayer = new ElementsLayer();

            Map.Layers.Add(DrawLayer);
            _startPoint = firstPoint;

            _polygon = new PolygonElement();
            #region 所有风格的控制
            _polygon.Stroke = this.Stroke;
            _polygon.StrokeThickness = this.StrokeThickness;
            _polygon.StrokeMiterLimit = this.StrokeMiterLimit;
            _polygon.StrokeDashOffset = this.StrokeDashOffset;
            _polygon.StrokeDashArray = this.StrokeDashArray;
            _polygon.StrokeDashCap = this.StrokeDashCap;
            _polygon.StrokeEndLineCap = this.StrokeEndLineCap;
            _polygon.StrokeLineJoin = this.StrokeLineJoin;
            _polygon.StrokeStartLineCap = this.StrokeStartLineCap;
            _polygon.Opacity = this.Opacity;
            _polygon.Fill = this.Fill;
            _polygon.FillRule = this.FillRule;
            #endregion

            _points = new Point2DCollection();
            _polygon.Point2Ds = _points;
            _points.Add(firstPoint);
            _pointsCount++;
            _points.Add(firstPoint.Clone());
            _pointsCount++;
            DrawLayer.Children.Add(_polygon);

            _isActivated = true;
        }