Use the Sketch Editor to edit or sketch a new point, line, or polygon geometry on to a map.
      
  
    
Use case
A field worker could annotate features of interest on a map (via the GUI) such as location of dwellings (marked as points), geological features (polylines), or areas of glaciation (polygons).
How to use the sample
Choose which geometry type to sketch from one of the available buttons. Choose from points, multipoints, polylines, polygons, freehand polylines, freehand polygons, circles, ellipses, triangles, arrows and rectangles.
Use the control panel to cancel the sketch, undo or redo changes made to the sketch and to save the sketch to the graphics overlay. There is also the option to select a saved graphic and edit its geometry using the Sketch Editor. The graphics overlay can be cleared using the clear all button.
How it works
- Use 
SketchEditor.StartAsync()to start sketching. If editing an existing graphic's geometry, useSketchEditor.StartAsync(graphic.Geometry). - Use the 
UndoCommandandRedoCommandto undo and redo edits in the sketch. - Use a 
CompleteCommandto finish the sketch and get theGeometryresult. Use theCancelCommandto cancel the sketch. - Create a 
Graphicfor the geometry and add it to theGraphicsOverlayin the map view. 
Relevant API
- Geometry
 - Graphic
 - GraphicsOverlay
 - MapView
 - SketchCreationMode
 - SketchEditor
 
Tags
draw, edit
Sample Code
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage x:Class="ArcGISRuntime.Samples.SketchOnMap.SketchOnMap"
             xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:esriUI="clr-namespace:Esri.ArcGISRuntime.Xamarin.Forms;assembly=Esri.ArcGISRuntime.Xamarin.Forms">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="70" />
        </Grid.RowDefinitions>
        <esriUI:MapView x:Name="MyMapView" Grid.Row="0" />
        <Grid x:Name="DrawToolsGrid"
              Grid.Row="0"
              BackgroundColor="White"
              HorizontalOptions="Center"
              IsVisible="False"
              VerticalOptions="Start"
              WidthRequest="280">
            <Grid.RowDefinitions>
                <RowDefinition Height="50" />
                <RowDefinition Height="40" />
                <RowDefinition />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <Label Grid.Row="0"
                   Grid.Column="0"
                   HorizontalOptions="End"
                   Text="Sketch shape:"
                   VerticalOptions="Center" />
            <Picker x:Name="SketchModePicker"
                    Grid.Row="0"
                    Grid.Column="1"
                    HorizontalOptions="Fill"
                    VerticalOptions="CenterAndExpand" />
            <Button Grid.Row="1"
                    Grid.Column="1"
                    Clicked="StartSketch"
                    HeightRequest="35"
                    HorizontalOptions="Center"
                    Text="✍️"
                    VerticalOptions="Start"
                    WidthRequest="100" />
            <Button x:Name="EditButton"
                    Grid.Row="1"
                    Grid.Column="0"
                    Clicked="EditButtonClick"
                    HeightRequest="35"
                    HorizontalOptions="Center"
                    IsEnabled="False"
                    Text="⚒️"
                    VerticalOptions="Start"
                    WidthRequest="100" />
        </Grid>
        <Grid Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition />
                <ColumnDefinition />
                <ColumnDefinition />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <Button x:Name="DrawEditButton"
                    Grid.Column="0"
                    Clicked="ShowDrawTools"
                    Text="Sketch" />
            <Button x:Name="UndoButton"
                    Grid.Column="1"
                    Text="↩️" />
            <Button x:Name="RedoButton"
                    Grid.Column="2"
                    Text="↪️" />
            <Button x:Name="CompleteButton"
                    Grid.Column="3"
                    Text="✔️" />
            <Button x:Name="ClearButton"
                    Grid.Column="4"
                    Clicked="ClearButtonClick"
                    IsEnabled="False"
                    Text="🗑" />
        </Grid>
    </Grid>
</ContentPage>