private void MyDrawObject_DrawComplete(object sender, ESRI.ArcGIS.Client.DrawEventArgs args) { GraphicsLayer graphicsLayer = MyMap.Layers["MyGraphicsLayer"] as GraphicsLayer; Envelope envelope = (Envelope)args.Geometry; Polygon rectangle = new Polygon(); PointCollection pointCollection = new PointCollection { new MapPoint(envelope.XMin, envelope.YMin), new MapPoint(envelope.XMin, envelope.YMax), new MapPoint(envelope.XMax, envelope.YMax), new MapPoint(envelope.XMax, envelope.YMin), new MapPoint(envelope.XMin, envelope.YMin) }; rectangle.Rings.Add(pointCollection); ESRI.ArcGIS.Client.Graphic graphic = new ESRI.ArcGIS.Client.Graphic() { Geometry = rectangle, Symbol = _activeSymbol, }; graphicsLayer.Graphics.Add(graphic); }
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.