ArcGIS Runtime SDK for iOS: AGSGraphic Class Reference
ArcGIS Runtime SDK for iOS  100.12
AGSGraphic Class Reference

Description

A graphic on top of a map.

Instances of this class represent graphics. Graphics can be displayed on the map through an AGSGraphicsOverlay. Graphics can be used as input to a task, or they can be used to display output from a task, or in response to user interaction.

Each graphic must contain an AGSGeometry 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 an AGSSymbol which determines how the graphic looks. Alternatively, the graphics overlay can be assgined an AGSRenderer which determines the appearance of all graphics in the overlay. Note, symbols associated with individual graphics take precedence over the symbols chosen by the renderer. The symbol used depends upon the geometry type associated with the graphic. An AGSMarkerSymbol is used for point and multipoint geometries, AGSLineSymbol for polyline geometries, and AGSFillSymbol for polygon geometries.

A graphic can contain a set of attributes (key-value pairs) providing more information about the graphic. Some of this information can be displayed in an AGSCallout when a user taps on the graphic.

Graphic objects respond to key value coding (KVC) methods for setting and getting attribute values.

Since
100
Inheritance diagram for AGSGraphic:
AGSObject <AGSGeoElement>

Instance Methods

(instancetype) - initWithGeometry:symbol:attributes:
 

Class Methods

(instancetype) + graphic
 
(instancetype) + graphicWithGeometry:symbol:attributes:
 

Properties

NSMutableDictionary< NSString *, id > * attributes
 
AGSGeometrygeometry
 
AGSGraphicsOverlaygraphicsOverlay
 
BOOL selected
 
AGSSymbolsymbol
 
BOOL visible
 
NSInteger zIndex
 

Method Documentation

◆ graphic

+ (instancetype) graphic

Creates a new graphic.

Returns
A new graphic.
Since
100

◆ graphicWithGeometry:symbol:attributes:

+ (instancetype) graphicWithGeometry: (nullable AGSGeometry *)  geometry
symbol: (nullable AGSSymbol *)  symbol
attributes: (nullable NSDictionary< NSString *, id > *)  attributes 

Create a new graphic.

Parameters
geometryspecifying the location and shape of the graphic.
symbolspecifying how the graphic should be rendered.
attributesof key-value pairs representing information associated with the graphic.
Returns
A new graphic.
Since
100

◆ initWithGeometry:symbol:attributes:

- (instancetype) initWithGeometry: (nullable AGSGeometry *)  geometry
symbol: (nullable AGSSymbol *)  symbol
attributes: (nullable NSDictionary< NSString *, id > *)  attributes 

Initialize a new graphic.

Parameters
geometryspecifying the location and shape of the graphic.
symbolspecifying how the graphic should be rendered.
attributesof key-value pairs representing information associated with the graphic.
Since
100

Property Documentation

◆ attributes

- (NSMutableDictionary<NSString*,id>*) attributes
readnonatomicstrong

A dictionary containing all the attributes.

Since
100

◆ geometry

- (AGSGeometry*) geometry
readwritenonatomicstrong

The geometry that defines shape and location.

Since
100

◆ graphicsOverlay

- (AGSGraphicsOverlay*) graphicsOverlay
readnonatomicweak

The graphics overlay containing this graphic, if any.

Since
100

◆ selected

- (BOOL) selected
readwritenonatomicassign

Specifies whether the graphic should appear selected or not.

See also
AGSGraphicsOverlay::selectionColor
Since
100

◆ symbol

- (AGSSymbol*) symbol
readwritenonatomicstrong

Symbol with which the graphic should be rendered.

Since
100

◆ visible

- (BOOL) visible
readwritenonatomicassign

Specifies whether the graphic should be visible or not.

Since
100

◆ zIndex

- (NSInteger) zIndex
readwritenonatomicassign

Defines the draw order for graphics. Graphics with higher Z-index values are drawn on top of lower Z-index graphics 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 AGSGraphic::zIndex property 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 AGSMapView or AGSSceneView objects.

Since
100