Graphics Overlay
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:
GraphicsRenderingMode.Dynamic - graphics are updated immediately as the GeoView is panned or zoomed (default).
GraphicsRenderingMode.Static - graphics are updated once the pan or zoom operation on the GeoView is finished. This is best for rendering large numbers of graphics.
Since
200.1.0
Constructors
Creates a graphics overlay object containing the given graphics.
Properties
Calculates and returns the extent of the GraphicsOverlay.graphics collection. The extent's com.arcgismaps.geometry.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.
Defines properties for dynamically aggregating and summarizing groups of graphics as the map scale and visible extent change. com.arcgismaps.mapping.reduction.FeatureReduction is only supported for point graphics in dynamic rendering mode (GraphicsRenderingMode.Dynamic) in 2D. com.arcgismaps.mapping.reduction.FeatureReduction is ignored and will result in the original point graphics being rendered for a GraphicsOverlay that:
The modifiable collection of graphics in this graphics overlay. You can add or remove graphics from this collection to modify what is displayed in the GeoView.
A string that identifies the graphics overlay in the GeoView.graphicsOverlays collection. You can give a graphics overlay an ID. If the collection of graphics overlays in a GeoView contains several graphics overlays, you can use the ID to find the one you need.
The modifiable collection of com.arcgismaps.mapping.labeling.LabelDefinition objects for this graphics overlay. A com.arcgismaps.mapping.labeling.LabelDefinition defines the text, appearance, and position of labels for the GraphicsOverlay.graphics. You can manage graphic labeling by defining new com.arcgismaps.mapping.labeling.LabelDefinition objects and adding or removing them from this collection.
True if labels are displayed for graphics in this graphics overlay, false otherwise.
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.
The scene properties for the graphics overlay. Use scene properties to control how graphics are displayed in a SceneView. For example, you can adjust the LayerSceneProperties.altitudeOffset or the LayerSceneProperties.surfacePlacement in the SceneView.
An array containing all selected graphics in the graphics overlay.
Inherited properties
A flag indicating whether the PopupDefinition defined on the PopupSource is enable / disable. Will return false if an error occurs.
The pop-up definition. The PopupDefinition associated with the popup source. A null if an error occurs or if the popup source is not associated with a pop-up definition.
Functions
Deselects all graphics in the graphics overlay.
Selects the specified graphics. Any graphics that are not in the overlay will be ignored.
Unselects the specified graphics. Any graphics that are not in the overlay will be ignored.