Пример #1
0
        private void FinalizePolygon()
        {
            Debug.WriteLine("Finishing polygon...");

            ICoordinate firstCoordinate = _points[0];
            ICoordinate lastCoordinate  = _points.Last();

            Point first = MapAroundControl.MapToClient(firstCoordinate);
            Point last  = MapAroundControl.MapToClient(lastCoordinate);


            var rectangle = MapAroundControl.GetViewBox();

            DrawLine(rectangle, Color.Green, first, last);

            _isFinalized = true;

            Polygon polygon        = new Polygon(_points);
            Feature polygonFeature = new Feature(FeatureType.Polygon)
            {
                Polygon = polygon
            };

            _userRegionLayer.AddPolygon(polygonFeature);
            _points.Clear();
            ClearRasterLayers();
            MapAroundControl.RedrawMap();
        }