Example #1
0
 public MG_Polygon(MG_Polygon p)
 {
     this.Type        = MG_GeometryType.POLYGON;
     this.LineStrings = new List <MG_LineString>();
     if (p != null)
     {
         for (int i = 0; i < p.Count(); i++)
         {
             MG_LineString l = new MG_LineString(p.GetAt(i));
             this.LineStrings.Add(l);
         }
     }
 }
Example #2
0
 public MG_Polygon(MG_Polygon p)
 {
     this.Type = MG_GeometryType.POLYGON;
     this.LineStrings = new List<MG_LineString>();
     if (p != null)
     {
         for (int i = 0; i < p.Count(); i++)
         {
             MG_LineString l = new MG_LineString(p.GetAt(i));
             this.LineStrings.Add(l);
         }
     }
 }
Example #3
0
 public static void RenderPolygon(Graphics g, Pen pen, MG_MapView mapview, MG_Polygon polygon)
 {
     int countLineString = polygon.Count();
     for (int i = 0; i < countLineString; i++)
     {
         MG_LineString lineString = polygon.GetAt(i);
         int countPoint = lineString.Count();
         if (countPoint < 3)
             return;
         Point[] points = new Point[countPoint];
         for (int j = 0; j < countPoint; j++)
         {
             MG_Point mp = lineString.GetAt(j);
             points[j] = AsPoint(mp, mapview);
         }
         //FillPolygon(g, brush, points);
         //Pen pen = new Pen(Color.Red, 1);
         DrawPolygon(g, pen, points);
     }
 }