void labeledPolygon(ESRI.ArcGIS.Client.Geometry.Polygon inPolygon) { Graphic polygonGraphic = new Graphic(); SimpleFillSymbol fillSymbol = new SimpleFillSymbol() { BorderBrush = borderBrush, Fill = fillBrush }; polygonGraphic.Symbol = fillSymbol; polygonGraphic.Geometry = inPolygon; Envelope extentEnvelope = inPolygon.Extent; MapPoint centerPoint = extentEnvelope.GetCenter(); Graphic textGraphic = new Graphic(); TextSymbol textSymbol = new TextSymbol() { //Text properties }; textGraphic.Symbol = textSymbol; textGraphic.Geometry = centerPoint; //Add the two graphics to the map. }
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.