GraphicsOverlay

class GraphicsOverlay : PopupSource

Contains a collection of graphics for display in a map or scene view. Graphics overlays display on top of all other data in a map or scene view. A graphics overlay can contain graphics of various geometry types and can define symbology for the graphics it contains using its GraphicsOverlay.getRenderer().

A graphic's Z-index can be used to define its draw order in the collection and is mostly relevant for display in a two dimensional map. For dynamic 3D rendering (in a scene), graphic display order is determined by the distance to the camera rather than by Z-index. Z-index is considered, however, when using static rendering in a scene (draping graphics on the surface, in other words).

If Z-index for graphics is not set, they will usually 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.getZIndex() explicitly on graphics. You can also place graphics of the same geometry type in their own graphics overlay and manage the order of the overlays in the view.

Constructors

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

Creates a graphics overlay object containing the given graphics.

Functions

Link copied to clipboard
fun clearSelection()

Deselect all graphics in the graphics overlay.

Link copied to clipboard
fun selectGraphics(graphics: Iterable<Graphic>)

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

Link copied to clipboard
fun unselectGraphics(graphics: Iterable<Graphic>)

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

Properties

Link copied to clipboard
val extent: Envelope?

Calculate and return the extent of the graphics contained in the overlay's graphics collection. The extent's spatial reference 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
val graphics: MutableList<Graphic>
Link copied to clipboard
var id: String

The overlay's id. The default value of id is an empty string. A graphics overlay's id does not need to be unique.

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
var isVisible: Boolean

The visibility for the graphics overlay. All of the connected map views will be updated.

Link copied to clipboard
val labelDefinitions: MutableList<LabelDefinition>
Link copied to clipboard
var labelsEnabled: Boolean

True if labels should be displayed.

Link copied to clipboard
var maxScale: Double

The maximum scale for the graphics overlay. This controls the maximum scale level the graphics overlay can zoom to. All of the connected map views will be updated.

Link copied to clipboard
var minScale: Double

The minimum scale for the graphics overlay. This controls the minimum scale level the graphics overlay can zoom to. All of the connected map views will be updated.

Link copied to clipboard
var opacity: Float

The opacity for the graphics overlay. All of the connected map views will be updated.

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.

Link copied to clipboard
var renderer: Renderer?
Link copied to clipboard
var renderingMode: GraphicsRenderingMode

The graphic overlay's rendering mode.

Link copied to clipboard
var scaleSymbols: Boolean

Whether the overlay's symbols and labels honor the map reference scale when displayed in a map view. 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.getScaleSymbols() is false, the symbols and labels will be drawn at their fixed screen size. The default value is 'false'. GraphicsOverlay.scaleSymbols only affects display in a MapView. The symbols and labels will be displayed at fixed screen size in a SceneView.

Link copied to clipboard
var sceneProperties: LayerSceneProperties
Link copied to clipboard
val selectedGraphics: List<Graphic>

An array containing all selected graphics in the graphics overlay.