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

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
Pan and zoom around the map. Observe the graphics on the map.
How it works
- Create a
GraphicsOverlayobject. - Create an instance of a
Symbolsubclass, such asSimpleFillSymbol,SimpleLineSymbol,SimpleMarkerSymbol, orTextSymbol. - Create a
Graphicinstance, specifying aGeometry, attributes, and aSymbol. - Add the graphic to the graphics overlay.
- Create a
MapViewinstance with the graphics overlay.
Relevant API
- Geometry
- Graphic
- GraphicsOverlay
- SimpleFillSymbol
- SimpleLineSymbol
- SimpleMarkerSymbol
- TextSymbol
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 “Style graphics with renderer” sample.
Tags
display, fill, graphics, line, marker, overlay, point, symbol