AGSGraphic Class Reference


Description

Instances of this class represent graphics. Graphics can be displayed on the map through an AGSGraphicsLayer. 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 must have the same spatial reference as the map.

A graphic can be associated with an AGSSymbol which determines how the graphic looks. Alternatively, the graphics layer can be assgined an AGSRenderer which determines the appearance of all graphics in the layer. 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, AGSSimpleLineSymbol for polyline geometries, and AGSSimpleFillSymbol for polygon geometries.

A graphic can contain a set of attributes (key-value paris) providing more information about the graphic. This information is displayed in an AGSCallout when a user taps on the graphic.

A graphic can also contain an infoTemplateDelegate that describes how attribute information should be displayed in the callout.

Defined in:
AGSGraphic.h ( ArcGIS library)
Since:
1.0
See also:
AGSMapViewDelegate for events related to tapping on graphics and showing the callout window.
Inheritance diagram for AGSGraphic:
<AGSCoding> AGSDirectionGraphic AGSFacilityGraphic AGSIncidentGraphic AGSStopGraphic

List of all members.

Public Member Functions

(void) - decodeWithJSON:
(NSDictionary *) - encodeToJSON
(id) - initWithGeometry:symbol:attributes:infoTemplateDelegate:
(id) - initWithJSON:

Static Public Member Functions

(id) + graphicWithGeometry:symbol:attributes:infoTemplateDelegate:

Properties

NSMutableDictionary * attributes
AGSGeometrygeometry
id< AGSInfoTemplateDelegateinfoTemplateDelegate
AGSGraphicsLayerlayer
AGSSymbolsymbol

Member Function Documentation

- (void) decodeWithJSON: (NSDictionary *)  json   [optional, inherited]

Decode object from JSON representation.

Parameters:
json The JSON representation of the object to be decoded.
Since:
1.0
- (NSDictionary *) encodeToJSON   [optional, inherited]

Encode and return JSON representation for object.

Returns:
JSON representation of object.
Since:
1.0
+ (id) graphicWithGeometry: (AGSGeometry *)  geometry
symbol: (AGSSymbol *)  symbol
attributes: (NSMutableDictionary *)  attributes
infoTemplateDelegate: (id< AGSInfoTemplateDelegate >)  infoTemplateDelegate 

Returns autoreleased graphic object. Only the geometry argument is mandatory.

Parameters:
geometry The geometry defining the graphic.
symbol The symbol used to draw the graphic. Can be nil.
attributes Name-value pairs of fields and field values associated with the graphic.
infoTemplateDelegate The template describing how to display attributes in the callout. Can be nil.
Returns:
A new, autoreleased, graphic object.
Since:
1.0
- (id) initWithGeometry: (AGSGeometry *)  geometry
symbol: (AGSSymbol *)  symbol
attributes: (NSMutableDictionary *)  attributes
infoTemplateDelegate: (id< AGSInfoTemplateDelegate >)  infoTemplateDelegate 

Initialize the graphic object. Only the geometry argument is mandatory.

Parameters:
geometry The geometry defining the graphic.
symbol The symbol used to draw the graphic. Can be nil.
attributes Name-value pairs of fields and field values associated with the graphic.
infoTemplateDelegate The template describing how to display attributes in the callout. Can be nil.
Returns:
A new graphic object.
Since:
1.0
- (id) initWithJSON: (NSDictionary *)  json   [optional, inherited]

Initialize and return object from JSON representation.

Parameters:
json The JSON representation of the object to be created.
Returns:
Object decoded from JSON representation.
Since:
1.0

Property Documentation

- (NSMutableDictionary*) attributes [read, write, retain]

Attributes representing additional information about this graphic. Consists of key-value pairs of field names and field values.

Since:
1.0
- (AGSGeometry*) geometry [read, write, retain]

The geometry that defines the graphic's shape and location.

Since:
1.0
- (id<AGSInfoTemplateDelegate>) infoTemplateDelegate [read, write, assign]

Template describing how the callout should display this graphic's attributes.

See also:
AGSCalloutTemplate
Since:
1.0
- (AGSGraphicsLayer*) layer [read, assign]

The graphics layer that this graphic belongs to, if any.

Since:
1.8
- (AGSSymbol*) symbol [read, write, retain]

The symbol for the graphic.

Since:
1.0