Graphic QML Type

A visual element displayed in a GraphicsOverlay. More...

Import Statement: import Esri.ArcGISRuntime 100.15
Since: Esri.ArcGISRuntime 100.0
Inherits:

GeoElement

Properties

Signals

Methods

Detailed Description

Graphics are displayed on the map through a graphics overlay. Common uses of graphics include providing input to a task, displaying output from a task, or marking a location based on user interaction with the map.

Each graphic must contain a geometry describing the location and the shape of the graphic. The geometry preferably should be in the same spatial reference as the map, otherwise it will be reprojected on-the-fly (computationally expensive for large number of graphics).

A graphic can be associated with a symbol which determines how the graphic looks. Alternatively, the graphics overlay can be assigned a renderer which determines the appearance of all graphics in the overlay. If the graphic has an associated symbol, that symbol will override the renderer when displaying that graphic. The symbol used depends upon the geometry type associated with the graphic. A MarkerSymbol is used for point and multipoint geometries, LineSymbol for polyline geometries, and FillSymbol for polygon geometries.

A graphic can contain a list model of attributes (key-value pairs) providing more information about the graphic.

This QML type supports the following default properties. A default property may be declared inside another declared object without being assigned explicitly to a property.

TypeDefault Property
Geometrygeometry
Symbolsymbol

Example:

Create a graphic (JavaScript):

var point = ArcGISRuntimeEnvironment.createObject("Point", {x: -117, y: 34, spatialReference: Factory.SpatialReference.createWgs84()});
var simpleMarker = ArcGISRuntimeEnvironment.createObject("SimpleMarkerSymbol", {color: "black", size: 12, style: Enums.SimpleMarkerSymbolStyleCircle});
var graphic = ArcGISRuntimeEnvironment.createObject("Graphic", {symbol: simpleMarker, geometry: point});
graphic.attributes.insertAttribute("region", "Southern California");

See also GraphicsOverlay.

Property Documentation

attributes : AttributeListModel

The attributes of the graphic as a list model of key-value pairs.


[default] geometry : Geometry

The geometry of the Graphic.


graphicsOverlay : GraphicsOverlay

The graphics overlay containing this graphic, if any (read-only).


selected : bool

Whether this graphic is selected.

See also GraphicsOverlay::selectedGraphics.


[default] symbol : Symbol

The symbol of the Graphic.


visible : bool

Whether this graphic is visible.


zIndex : int

The z-index of the graphic.

Defines the draw order for graphics. Graphics with higher Z-index values are drawn on top of lower Z-index graphics. Graphics with higher Z-index values are drawn on top of graphics with lower values. Values may be negative. A graphic's Z-index 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 is not set, graphics 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 Z-index 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 MapView or SceneView.


Signal Documentation

geometryChanged()

Emitted when the geometry property of this Graphic changes.

Note: The corresponding handler is onGeometryChanged.


selectedChanged()

Emitted when the selected property of this Graphic changes.

Note: The corresponding handler is onSelectedChanged.


symbolChanged()

Emitted when the symbol property of this Graphic changes.

Note: The corresponding handler is onSymbolChanged.


visibleChanged()

Emitted when the visible property of this Graphic changes.

Note: The corresponding handler is onVisibleChanged.


zIndexChanged()

Emitted when the zIndex property of this Graphic changes.

Note: The corresponding handler is onZIndexChanged.


Method Documentation

bool equals(Graphic other)

Returns true if other is equal to this Graphic.


Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.