<esri:SimpleFillSymbol x:Key="RedFillSymbol" Fill="#66FF0000" BorderBrush="Red" BorderThickness="2" />
SimpleFillSymbol redFillSymbol= new SimpleFillSymbol(){ Fill = new SolidColorBrush(Color.FromArgb(102, 255, 0, 0)), BorderBrush = new SolidColorBrush(Colors.Red), BorderThickness = 2d};
private void AddPolygon() { GraphicsLayer graphicsLayer = MyMap.Layers["MyGraphicsLayer"] as GraphicsLayer; Polygon polygon = new Polygon(); PointCollection pts = new PointCollection(); pts.Add(new MapPoint(110.039, -20.303)); pts.Add(new MapPoint(132.539, -7.0137)); pts.Add(new MapPoint(153.281, -13.923)); pts.Add(new MapPoint(162.773, -35.174)); pts.Add(new MapPoint(133.594, -43.180)); pts.Add(new MapPoint(111.797, -36.032)); pts.Add(new MapPoint(110.039, -20.303)); polygon.Rings.Add(pts); Graphic graphic = new Graphic() { Geometry = polygon, Symbol = redFillSymbol // or LayoutRoot.Resources["RedFillSymbol"] as Symbol }; graphicsLayer.Graphics.Add(graphic); }
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.