Add graphics with symbols

View inAndroidFormsUWPWPFWinUIiOSView on GitHub

Use a symbol style to display a graphic on a graphics overlay.

Image of Add graphics with symbols

Use case

Allows you to customize a graphic by assigning a unique symbol. For example, you may wish to display individual graphics for different landmarks across a region, and to style each one with a unique symbol.

How to use the sample

Observe the graphics on the map.

How it works

  1. Create a GraphicsOverlay and add it to the MapView.
  2. Create a Symbol such as SimpleMarkerSymbol, SimpleLineSymbol or SimpleFillSymbol.
  3. Create a Graphic, specifying a Geometry and a Symbol.
  4. Add the Graphic to the GraphicsOverlay.

Relevant API

  • Geometry
  • Graphic
  • GraphicsOverlay
  • SimpleFillSymbol
  • SimpleLineSymbol
  • SimpleMarkerSymbol

Additional information

To set a symbol style across a number of graphics (e.g. showing trees as graphics sharing a symbol in a park), see the "Add graphics with renderer" sample.

Tags

display, fill, graphics, line, marker, overlay, point, symbol

Sample Code

AddGraphicsWithSymbols.xamlAddGraphicsWithSymbols.xamlAddGraphicsWithSymbols.xaml.cs
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage x:Class="ArcGISRuntime.Samples.AddGraphicsWithSymbols.AddGraphicsWithSymbols"
             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>
        <esriUI:MapView x:Name="MyMapView" />
    </Grid>
</ContentPage>

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.