11,12;MyPointNamed -35,51;-36,80;-100,42;-40,18;-35,51 -127,51;-84,2;0,0;-2,-40 11,16 11,20 11,24 11,28 11,32 21,32 31,32 41,32 51,32 61,42 71,52 81,62
PointCollection pts = new PointCollection(); // replace these points with the proper values pts.Add(new MapPoint(-35,51)); pts.Add(new MapPoint(-36,80)); Polygon p = new Polygon(); p.Rings.Add(pts); Graphic g = new Graphic() { Geometry = p };
You need to parse the text file, create a PointCollection of MapPoints based on the (lat, lon) values. This PointCollection will be added to the ring(s) of your Polygon, which will become the Graphic's Geometry.PointCollection pts = new PointCollection(); // replace these points with the proper values pts.Add(new MapPoint(-35,51)); pts.Add(new MapPoint(-36,80)); Polygon p = new Polygon(); p.Rings.Add(pts); Graphic g = new Graphic() { Geometry = p };