Manages a collection of graphics that can be displayed in a map view or scene view. Graphics overlays displays a collection of graphics on top of all the layers (including reference layers) in a map view or scene view. Every map view or scene view can contain a collection of graphics overlays (GeoView.graphicsOverlays), and each graphics overlay can contain a collection of graphics (GraphicsOverlay.graphics). The graphics in the first GraphicsOverlay are drawn first, with subsequent GraphicsOverlay.graphics on top. The GraphicsOverlay.renderer defines the symbology of the GraphicsOverlay.graphics collection.
A graphic's Graphic.zIndex value defines its draw order within the graphics overlay that contains it. The Graphic.zIndex value applies in a map view and a scene view if the scene view drapes the graphics on the surface (SurfacePlacement.DrapedFlat). In other scene view rendering, the graphic's display order is determined by the distance to the camera rather than by Z-index.
If the Graphic.zIndex value is not set, graphics will render in the order in which they were added to the graphics overlay. The first added is rendered first and subsequent ones on top. In rare cases, the rendering algorithm may change the display order to provide more efficient rendering. If ordering is important, set the Graphic.zIndex explicitly on graphics.
To improve view responsiveness, you can set the GraphicsOverlay.renderingMode to either of these options:
Calculates and returns the extent of the GraphicsOverlay.graphics collection. The extent's SpatialReference is that of the GeoView that contains the overlay. If the overlay is not in a view, returns null. If the overlay is in a view but that view does not yet have a spatial reference, returns null. If the overlay is in a view with a spatial reference, but has no graphics, then an empty envelope will be returned.
The modifiable collection of LabelDefinition objects for this graphics overlay. A LabelDefinition defines the text, appearance, and position of labels for the GraphicsOverlay.graphics. You can manage graphic labeling by defining new LabelDefinition objects and adding or removing them from this collection.
The maximum scale at which to display the graphics overlay. A small number allows the map to display the layer when zooming further in. This controls the maximum scale at which the graphics overlay is displayed. If the current map scale is smaller than the maximum scale, then this graphics overlay will not be displayed.
The minimum scale at which to display the graphics overlay. A large number allows the map to display the layer when zooming further out. This controls the minimum scale at which the graphics overlay is displayed. If the current map scale is larger than the minimum scale, then this graphics overlay will not be displayed.
The rendering mode used to display graphics in the overlay. For more efficient rendering of large numbers of graphics, set the rendering mode to GraphicsRenderingMode.Static. In order to ensure map responsiveness, static rendering does not refresh the display while pan and zoom operations are in progress. The amount of graphics an overlay can handle in this mode is mainly limited by the system memory.
True if the graphic overlay's symbols and labels honor the map reference scale when displayed in a map view, false otherwise. If the map has a positive reference scale, and the overlay honors it, then symbols and labels will be drawn at their specified size when the viewing scale is the same as the reference scale. They will grow or shrink as the view zooms in or out to keep the symbol a fixed size on the map. If the map has no reference scale, the reference scale is zero, or GraphicsOverlay.scaleSymbols is false, the symbols and labels will be drawn at their fixed screen size.