<esri:SimpleLineSymbol x:Key="DrawLineSymbol" Color="Green" Width="4" /> <esri:SimpleFillSymbol x:Key="DrawFillSymbol" Fill="#3300FF00" BorderBrush="Green" BorderThickness="2" /> <esri:SimpleFillSymbol x:Key="DefaultFillSymbol" Fill="#33FF0000" BorderBrush="Red" BorderThickness="2" />
<Button Content="Complete" Margin="0,5,5,0" Click="Button_Click" />
draw = new Draw(MyMap) { LineSymbol = LayoutRoot.Resources["DrawLineSymbol"] as LineSymbol, FillSymbol = LayoutRoot.Resources["DrawFillSymbol"] as FillSymbol, DrawMode = DrawMode.Polygon, IsEnabled = true }; draw.DrawComplete += draw_DrawComplete; } Draw draw; void draw_DrawComplete(object sender, DrawEventArgs e) { graphicsLayer.Graphics.Add (new Graphic() { Geometry = e.Geometry, Symbol = LayoutRoot.Resources["DefaultFillSymbol"] as Symbol }); MyMap.PanTo(e.Geometry); } private void Button_Click(object sender, RoutedEventArgs e) { draw.CompleteDraw(); draw.IsEnabled = false; }
draw.AddVertex(resultMapPoint); //graphicsLayer.Graphics.Add(resultGraphic);
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.