How to create a polygon using lat lng coordinates?

Oct 4, 2010 at 12:58 PM

I need to create a polygon with  the lat & lng of each point.

I try some bizarre code but I fail

GMap.NET.Point p = PureProjection.FromLatLngToPixel(43.515754895, -5.680918693, MainMap.Zoom);

 

MyPolygon.LocalPoints.Add(p, MainMap.Zoom)); 

Thanks and best regards

Coordinator
Oct 4, 2010 at 6:20 PM
         if(polygon == null)
         {
            polygon = new GMapPolygon(polygonPoints, "polygon test");
            polygons.Polygons.Add(polygon);
         }
         else
         {
            polygon.Points.Clear();
            polygon.Points.AddRange(polygonPoints);

            if(polygons.Polygons.Count == 0)
            {
               polygons.Polygons.Add(polygon);
            }
            else
            {
               MainMap.UpdatePolygonLocalPosition(polygon);
            }
         }