ArcGIS Runtime SDK for iOS: AGSUniqueValueRenderer Class Reference
ArcGIS Runtime SDK for iOS  100.15
AGSUniqueValueRenderer Class Reference

Description

A renderer based on unique values.

A unique value renderer symbolizes groups of graphics or features that have matching attributes with the same symbol. This is most common with nominal, or string data. Different groups use different symbols.

For example, you could use a unique value renderer to symbolize zoning designations: yellow for "Residential", purple for "Industrial", red for "Commercial", and so on. You can also use unique value renderers on numeric fields that are coded values, or on ordinal attributes such as "First", "Second", "Third", and so on.

Typically, graphics and features are rendered based on the unique values of one attribute field. However, up to three fields can be combined to generate a unique value.

Since
100
Inheritance diagram for AGSUniqueValueRenderer:
AGSRenderer AGSObject <AGSJSONSerializable>

Instance Methods

(instancetype) - initWithFieldNames:uniqueValues:defaultLabel:defaultSymbol:
 
(BOOL) - isEqualToRenderer:
 
(AGSSymbol *) - symbolForFeature:
 
(AGSSymbol *) - symbolForFeature:applyAttributeOverrides:
 
(AGSSymbol *) - symbolForGraphic:
 
(AGSSymbol *) - symbolForGraphic:applyAttributeOverrides:
 
(nullable id) - toJSON:
 

Class Methods

(nullable id< AGSJSONSerializable >) + fromJSON:error:
 
(instancetype) + uniqueValueRenderer
 
(instancetype) + uniqueValueRendererWithFieldNames:uniqueValues:defaultLabel:defaultSymbol:
 

Properties

NSString * defaultLabel
 
AGSSymboldefaultSymbol
 
NSArray< NSString * > * fieldNames
 
NSString * rotationExpression
 
AGSRotationType rotationType
 
AGSRendererScenePropertiessceneProperties
 
NSArray< AGSUniqueValue * > * uniqueValues
 
NSDictionary< NSString *, id > * unknownJSON
 
NSDictionary< NSString *, id > * unsupportedJSON
 

Method Documentation

◆ fromJSON:error:

+ (nullable id<AGSJSONSerializable>) fromJSON: (id)  JSONObject
error: (NSError **)  error 
staticrequiredinherited

Initializes and returns an object from its JSON representation.

Parameters
JSONObjectNSDictionary or NSArray containing the JSON.
errorencountered during the operation, if any.
Since
100

◆ initWithFieldNames:uniqueValues:defaultLabel:defaultSymbol:

- (instancetype) initWithFieldNames: (nullable NSArray< NSString * > *)  fieldNames
uniqueValues: (nullable NSArray< AGSUniqueValue * > *)  uniqueValues
defaultLabel: (NSString *)  defaultLabel
defaultSymbol: (nullable AGSSymbol *)  defaultSymbol 

Initialize a unique value renderer with the given properties.

Parameters
fieldNamesAn array of strings with field names representing attributes of a graphic or feature that the renderer uses to match values against.
uniqueValuesAn array of AGSUniqueValue objects defining the symbol for each matched value
defaultLabelfor the renderer
defaultSymbolused for any unmatched values
Returns
A unique value renderer object.
Since
100

◆ isEqualToRenderer:

- (BOOL) isEqualToRenderer: (AGSRenderer *)  other

Compares two renderers for equality.

Parameters
otherrenderer to compare this one to.
Returns
YES if other is equal to self, otherwise NO.
Since
100

◆ symbolForFeature:

- (AGSSymbol*) symbolForFeature: (AGSFeature *)  feature

Creates a symbol for the feature based on the scheme used by this renderer.

Parameters
featureThe feature to determine the symbol for.
Returns
A new symbol for the feature.
Since
100

◆ symbolForFeature:applyAttributeOverrides:

- (AGSSymbol*) symbolForFeature: (AGSFeature *)  feature
applyAttributeOverrides: (BOOL)  applyAttributeOverrides 

Creates a symbol for the feature based on the scheme used by this renderer and optionally apply attribute overrides.

If applyAttributeOverrides is set to YES and renderer contains an override expression, this method will return a symbol modified by the expression. If the expression cannot be properly evaluated due to missing fields or external data, then the original symbol is returned.

Parameters
featureThe feature to determine the symbol for.
applyAttributeOverridesIf set YES, applies the override attributes from the renderer.
Returns
A symbol for the feature.
Since
105

◆ symbolForGraphic:

- (AGSSymbol*) symbolForGraphic: (AGSGraphic *)  graphic

Creates a symbol for the graphic based on the scheme used by this renderer.

Parameters
graphicThe graphic to determine the symbol for.
Returns
A symbol for the graphic.
Since
100

◆ symbolForGraphic:applyAttributeOverrides:

- (AGSSymbol*) symbolForGraphic: (AGSGraphic *)  graphic
applyAttributeOverrides: (BOOL)  applyAttributeOverrides 

Creates a symbol for the graphic based on the scheme used by this renderer and optionally apply attribute overrides.

Parameters
graphicThe graphic to determine the symbol for.
applyAttributeOverridesIf set YES, applies the override attributes from the renderer.
Returns
A symbol for the graphic.
Since
100.5

◆ toJSON:

- (nullable id) toJSON: (NSError **)  error
requiredinherited

Returns JSON representation for this object.

Parameters
errorencountered during the operation, if any.
Returns
NSDictionary or NSArray containing the JSON.
Since
100

Reimplemented in AGSPortalItem.

◆ uniqueValueRenderer

+ (instancetype) uniqueValueRenderer

Initialize a unique value renderer.

Returns
A unique value renderer object.
Since
100

◆ uniqueValueRendererWithFieldNames:uniqueValues:defaultLabel:defaultSymbol:

+ (instancetype) uniqueValueRendererWithFieldNames: (nullable NSArray< NSString * > *)  fieldNames
uniqueValues: (nullable NSArray< AGSUniqueValue * > *)  uniqueValues
defaultLabel: (NSString *)  defaultLabel
defaultSymbol: (nullable AGSSymbol *)  defaultSymbol 

Initialize a unique value renderer with the given properties

Parameters
fieldNamesAn array of strings with field names representing attributes of a graphic or feature that the renderer uses to match values against.
uniqueValuesAn array of AGSUniqueValue objects defining the symbol for each matched value
defaultLabelfor the renderer
defaultSymbolused for any unmatched values
Returns
A unique value renderer object.
Since
100

Property Documentation

◆ defaultLabel

- (NSString*) defaultLabel
readwritenonatomiccopy

Default label for the renderer

Since
100

◆ defaultSymbol

- (AGSSymbol*) defaultSymbol
readwritenonatomicstrong

Default symbol for the renderer. This symbol is used for any unmatched values.

Since
100

◆ fieldNames

- (NSArray<NSString*>*) fieldNames
readwritenonatomiccopy

A list of strings with field names. The names represent attributes of a graphic or feature that the renderer uses to match values against.

Since
100

◆ rotationExpression

- (NSString*) rotationExpression
readwritenonatomiccopyinherited

Constant value or an expression that specifies the angle of rotation based on a feature's attribute value. When an attribute name is specified in rotationExpression, it's enclosed in square brackets, for example, [Rotation].

Since
100

◆ rotationType

- (AGSRotationType) rotationType
readwritenonatomicassigninherited

Controls the origin and direction of rotation. If the rotationType is defined as AGSRotationTypeTypeArithmetic, the symbol is rotated from East in a counter-clockwise direction where East is the 0° axis. If the rotationType is defined as AGSRotationTypeGeographic, the symbol is rotated from North in a clockwise direction where North is the 0° axis.

Since
100

◆ sceneProperties

- (AGSRendererSceneProperties*) sceneProperties
readwritenonatomicstronginherited

Properties to apply only when rendering data in 3D scenes using AGSSceneView.

Since
100

◆ uniqueValues

- (NSArray<AGSUniqueValue*>*) uniqueValues
readwritenonatomiccopy

An array of AGSUniqueValue objects defining the symbol for each matched value

Since
100

◆ unknownJSON

- (NSDictionary<NSString*,id>*) unknownJSON
readrequirednonatomiccopyinherited

A dictionary of values that was in the source JSON but was unparsed by API.

Returns
NSDictionary containing the unknown JSON.
Since
100

◆ unsupportedJSON

- (NSDictionary<NSString*,id>*) unsupportedJSON
readnonatomiccopyinherited

A dictionary of values that are supported by the REST API, but not exposed through the SDK API.

Returns
NSDictionary containing the unsupported JSON.
Since
100