Polyline polyline = new Polyline(); void draw_DrawComplete(object sender, DrawEventArgs e) { draw.IsEnabled = false; GraphicsLayer l = this.MyMap.Layers["MyGraphicsLayer"] as GraphicsLayer; Symbol s = this.LayoutRoot.Resources["MyRedLineSymbol"] as Symbol; if (polyline.Paths.Count == 2) { l.Graphics.Clear(); l.Graphics.Add(new Graphic() { Geometry = polyline, Symbol = s }); } else { polyline.Paths.Add((e.Geometry as Polyline).Paths[0]); l.Graphics.Add(new Graphic() { Geometry = e.Geometry, Symbol = s }); } }
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.