Esempio n. 1
0
        public static void RenderLineString(Graphics g, Pen pen, MG_MapView mapview, MG_LineString lineString)
        {
            int count = lineString.Count();

            if (count < 2)
            {
                return;
            }
            Point[] points = new Point[count];
            for (int i = 0; i < count; i++)
            {
                MG_Point mp = lineString.GetAt(i);
                points[i] = AsPoint(mp, mapview);
            }
            DrawLineString(g, pen, points);
        }
Esempio n. 2
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);
            }
        }