Skip To Content ArcGIS for Developers Sign In Dashboard

Graphic QML Type

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

Import Statement: import Esri.ArcGISRuntime 100.6
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: 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.

Graphics with higher z-index values are drawn on top of graphics with lower values. Values may be negative.


Signal Documentation

geometryChanged()

Emitted when the geometry property of this Graphic changes.


selectedChanged()

Emitted when the selected property of this Graphic changes.


symbolChanged()

Emitted when the symbol property of this Graphic changes.


visibleChanged()

Emitted when the visible property of this Graphic changes.


zIndexChanged()

Emitted when the zIndex property of this Graphic changes.


Method Documentation

bool equals(Graphic other)

Returns true if other is equal to this Graphic.



Feedback on this topic?