var env = e.Graphic.Geometry as Envelope; Polygon p = new Polygon() { SpatialReference = env.SpatialReference }; PointCollection ring = new PointCollection(); ring.Add(new MapPoint(env.XMin, env.YMin)); ring.Add(new MapPoint(env.XMin, env.YMax)); ring.Add(new MapPoint(env.XMax, env.YMax)); ring.Add(new MapPoint(env.XMax, env.YMin)); ring.Add(new MapPoint(env.XMin, env.YMin)); p.Rings.Add(ring); e.Graphic.Geometry = p;
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.