GraphicsOverlay

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:

Since

200.1.0

Constructors

Link copied to clipboard
constructor(graphics: Iterable<Graphic> = emptyList(), renderingMode: GraphicsRenderingMode = GraphicsRenderingMode.Dynamic)

Creates a graphics overlay object containing the given graphics.

Properties

Link copied to clipboard

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.

Link copied to clipboard

Defines properties for dynamically aggregating and summarizing groups of graphics as the map scale and visible extent change. FeatureReduction is only supported for point graphics in dynamic rendering mode (GraphicsRenderingMode.Dynamic) in 2D. FeatureReduction is ignored and will result in the original point graphics being rendered for a GraphicsOverlay that:

Link copied to clipboard

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.

Link copied to clipboard
var id: String

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.

Link copied to clipboard

True if the graphics overlay is visible, false otherwise.

Link copied to clipboard

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.

Link copied to clipboard

True if labels are displayed for graphics in this graphics overlay, false otherwise.

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

The opacity for the graphics overlay. Must be a value between 0 and 1 with 1 being solid or opaque and 0 being transparent. The default opacity is 1.

Link copied to clipboard

Defines how graphics in the overlay are symbolized when displayed. Symbols set on the individual graphics will override the renderer.

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

An array containing all selected graphics in the graphics overlay.

Inherited properties

Link copied to clipboard
open override var isPopupEnabled: Boolean

A flag indicating whether the PopupDefinition defined on the PopupSource is enable / disable. Will return false if an error occurs.

Link copied to clipboard
open override var popupDefinition: PopupDefinition?

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

Link copied to clipboard

Deselects all graphics in the graphics overlay.

Link copied to clipboard

Selects the specified graphics. Any graphics that are not in the overlay will be ignored.

Link copied to clipboard

Unselects the specified graphics. Any graphics that are not in the overlay will be ignored.