ArcGIS Runtime SDK for iOS: AGSTextSymbol Class Reference
ArcGIS Runtime SDK for iOS  100.6
AGSTextSymbol Class Reference

Description

Instances of this class represent text symbols. Symbols describe how graphics and features look on a map. Text symbols are used to display text for graphics and features. The graphic or feature can be based on any type of geometry - point, multipoint, polyline, or polygon.

Since
100
Inheritance diagram for AGSTextSymbol:
AGSMarkerSymbol AGSSymbol AGSObject <AGSJSONSerializable>

Instance Methods

(id< AGSCancelable >) - createSwatchWithBackgroundColor:screen:completion:
 
(id< AGSCancelable >) - createSwatchWithCompletion:
 
(id< AGSCancelable >) - createSwatchWithGeometry:width:height:screen:backgroundColor:completion:
 
(nullable id< AGSCancelable >) - createSwatchWithWidth:height:screen:backgroundColor:completion:
 
(instancetype) - initWithText:color:size:horizontalAlignment:verticalAlignment:
 
(BOOL) - isEqualToSymbol:
 
(nullable id) - toJSON:
 

Class Methods

(nullable id< AGSJSONSerializable >) + fromJSON:error:
 
(instancetype) + textSymbol
 
(instancetype) + textSymbolWithText:color:size:horizontalAlignment:verticalAlignment:
 

Properties

AGSSymbolRotationType rotationType __deprecated
 
float angle
 
AGSMarkerSymbolAngleAlignment angleAlignment
 
AGSColor * backgroundColor
 
AGSColor * color
 
AGSFontDecoration fontDecoration
 
NSString * fontFamily
 
AGSFontStyle fontStyle
 
AGSFontWeight fontWeight
 
AGSColor * haloColor
 
CGFloat haloWidth
 
AGSHorizontalAlignment horizontalAlignment
 
BOOL kerningEnabled
 
CGFloat leaderOffsetX
 
CGFloat leaderOffsetY
 
CGFloat offsetX
 
CGFloat offsetY
 
AGSColor * outlineColor
 
CGFloat outlineWidth
 
CGFloat size
 
NSString * text
 
NSDictionary< NSString *, id > * unknownJSON
 
NSDictionary< NSString *, id > * unsupportedJSON
 
AGSVerticalAlignment verticalAlignment
 

Method Documentation

§ createSwatchWithBackgroundColor:screen:completion:()

- (id<AGSCancelable>) createSwatchWithBackgroundColor: (nullable AGSColor *)  backgroundColor
screen: (nullable UIScreen *)  screen
completion: (void(^)(AGSImage *__nullable swatch, NSError *__nullable error))  completion 

Creates swatch with provided background color.

Parameters
backgroundColorDesired background color of the image
screenScreen that the swatch will be rendered for. If you specify nil then the main screen will be used.
completionblock that is invoked when operation completes.
Since
100

§ createSwatchWithCompletion:()

- (id<AGSCancelable>) createSwatchWithCompletion: (void(^)(AGSImage *__nullable swatch, NSError *__nullable error))  completion

Creates swatch with provided background color. This method uses main screen's scale to determine the size of the image.

Parameters
completionblock that is invoked when operation completes.
Since
100

§ createSwatchWithGeometry:width:height:screen:backgroundColor:completion:()

- (id<AGSCancelable>) createSwatchWithGeometry: (AGSGeometry *)  geometry
width: (NSInteger)  width
height: (NSInteger)  height
screen: (nullable UIScreen *)  screen
backgroundColor: (nullable AGSColor *)  backgroundColor
completion: (void(^)(AGSImage *__nullable swatch, NSError *__nullable error))  completion 

Creates swatch using provided geometry and other parameters. This is the most configurable of the methods to create swatches. You can pass the pixels per inch that you would like the image to be rendered at. This will determine how many pixels are used to render symbols of sizes that are specified in Points.

Parameters
geometryGeometry of the symbol to be drawn in the swatch image. The coordinates of the specified geometry are in pixels, with the point (0,0) located at the centerpoint of the swatch image. The x-axis increases towards the right-hand side of the swatch image. The y-axis increases towards the top of the swatch image. For example: when creating a swatch for a AGSSimpleMarkerSymbol, specifying a geometry of (10,10) will draw the marker 10 pixels up and to the right of the center of the swatch. The geometry (AGSPoint, AGSPolyline, AGSPolygon) correspond to the symbol (AGSSimpleMarkerSymbol, AGSSimpleLineSymbol, AGSSimpleFillSymbol). The geometry's spatial reference is ignored.
widthDesired width of the image in pixels
heightDesired height of the image in pixels
screenScreen that the swatch will be rendered for. If you specify nil then the main screen will be used.
backgroundColorDesired background color of the image
completionblock that is invoked when operation completes.
Since
100

§ createSwatchWithWidth:height:screen:backgroundColor:completion:()

- (nullable id<AGSCancelable>) createSwatchWithWidth: (NSInteger)  width
height: (NSInteger)  height
screen: (nullable UIScreen *)  screen
backgroundColor: (nullable AGSColor *)  backgroundColor
completion: (void(^)(AGSImage *__nullable swatch, NSError *__nullable error))  completion 

§ 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

§ initWithText:color:size:horizontalAlignment:verticalAlignment:()

- (instancetype) initWithText: (NSString *)  text
color: (AGSColor *)  color
size: (CGFloat)  size
horizontalAlignment: (AGSHorizontalAlignment horizontalAlignment
verticalAlignment: (AGSVerticalAlignment verticalAlignment 

Initialize a text symbol with the provided parameters

Parameters
sizeof the symbol in points (not pixels)
textto be displayed by the symbol
colorof the text
Returns
Initialized text symbol
Since
100

§ isEqualToSymbol:()

- (BOOL) isEqualToSymbol: (AGSSymbol *)  other

Compares this symbol to another for equality

Parameters
othersymbol to compare this one to
Returns
whether the two symbols are equal or not
Since
100

§ textSymbol()

+ (instancetype) textSymbol

Initialize a text symbol

Returns
Initialized text symbol
Since
100

§ textSymbolWithText:color:size:horizontalAlignment:verticalAlignment:()

+ (instancetype) textSymbolWithText: (NSString *)  text
color: (AGSColor *)  color
size: (CGFloat)  size
horizontalAlignment: (AGSHorizontalAlignment horizontalAlignment
verticalAlignment: (AGSVerticalAlignment verticalAlignment 

Initialize a text symbol with the provided parameters

Parameters
sizeof the symbol in points (not pixels)
textto be displayed by the symbol
colorof the text
Returns
Initialized text symbol
Since
100

§ 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.

Property Documentation

§ __deprecated

- (AGSSymbolRotationType rotationType) __deprecated
readwritenonatomicassigninherited

The rotation type of the marker symbol.

The default value is AGSSymbolRotationTypeArithmetic. This property is deprecated in release 100.5.

Since
100
Deprecated:
100.5 Will be removed in a future release. There is no other mechanism to specify the rotation type, but all angles are achievable by changing the value of the angle property.

Provided by category AGSMarkerSymbol(AGSDeprecated).

§ angle

- (float) angle
readwritenonatomicassigninherited

The angle (in degrees) of the marker symbol.

Since
100

§ angleAlignment

- (AGSMarkerSymbolAngleAlignment) angleAlignment
readwritenonatomicassigninherited

Specifies whether the symbol should rotate with the map/scene or stay at the same angle with regards to the screen. Default is AGSMarkerSymbolAngleAlignmentScreen which keeps it aligned with the screen. Only supported for graphics overlays when AGSGraphicsOverlay::renderingMode is AGSGraphicsRenderingModeDynamic, and for feature layers when AGSFeatureLayer::renderingMode is AGSFeatureRenderingModeDynamic

Since
100

§ backgroundColor

- (AGSColor*) backgroundColor
readwritenonatomicstrong

Background color for the text

Since
100.1

§ color

- (AGSColor*) color
readwritenonatomicstrong

Color of the text

Since
100

§ fontDecoration

- (AGSFontDecoration) fontDecoration
readwritenonatomicassign

Font decoration for the text

Since
100

§ fontFamily

- (NSString*) fontFamily
readwritenonatomiccopy

Font family for the text

Since
100

§ fontStyle

- (AGSFontStyle) fontStyle
readwritenonatomicassign

Font style for the text

Since
100

§ fontWeight

- (AGSFontWeight) fontWeight
readwritenonatomicassign

Font weight for the text

Since
100

§ haloColor

- (AGSColor*) haloColor
readwritenonatomicstrong

Color of the halo to put around the text.

See also
haloWidth
Since
100

§ haloWidth

- (CGFloat) haloWidth
readwritenonatomicassign

Width of the text halo

See also
haloColor
Since
100

§ horizontalAlignment

- (AGSHorizontalAlignment) horizontalAlignment
readwritenonatomicassign

Horizontal alignment of the text

Since
100

§ kerningEnabled

- (BOOL) kerningEnabled
readwritenonatomicassign

Indicates whether or not kerning should be applied to the text. Kerning affects spacing of two particular characters to correct for visually uneven spacing.

Since
100.1

§ leaderOffsetX

- (CGFloat) leaderOffsetX
readwritenonatomicassigninherited

Specifies how to position a callout's leader in relation to the symbol (for example, when a user taps on the map to display a callout for the feature or graphic). Default value is 0 and the callout's leader is positioned at the horizontal center of the symbol. The values specified here are interpreted in a cartesian coordinate system and in points (not pixels). Thus, a value of -5 will offset the callout's leader left on the x-axis by 5 points

Since
100

§ leaderOffsetY

- (CGFloat) leaderOffsetY
readwritenonatomicassigninherited

Specifies how to position a callout's leader in relation to the symbol (for example, when a user taps on the map to display a callout for the feature or graphic). Default value is 0 and the callout's leader is positioned at the vertical center of the symbol. The values specified here are interpreted in a cartesian coordinate system and in points (not pixels). Thus, a value of -5 will offset the callout's leader down on the y-axis by 5 points

Since
100

§ offsetX

- (CGFloat) offsetX
readwritenonatomicassigninherited

Specifies how to position the symbol in relation to the graphic or feature's point geometry. This is useful when the marker needs to be offset to properly coincide with a location on the map.

Default value is 0 and the symbol is centered horizontally on the point geometry. The values specified are interpreted in a cartesian coordinate system. Thus, a value of -5 will shift the marker left by 5 points on the x-axis.

For example, consider an AGSPictureMarkerSymbol using the image of a pushpin. By default, the center of the image will be used as the anchor to center the image at the map location. However, if you wanted the needle of the pushpin to end at the map location, you would need to offset the image appropriately to make the needle's end coincide with the map location.

Since
100

§ offsetY

- (CGFloat) offsetY
readwritenonatomicassigninherited

Specifies how to position the symbol in relation to the graphic or feature's point geometry. This is useful when the marker needs to be offset to properly coincide with a location on the map.

Default value is 0 and the symbol is centered vertically on the point geometry. The values specified are interpreted in a cartesian coordinate system. Thus, a value of -5 will shift the marker down by 5 points on the y-axis.

For example, consider an AGSPictureMarkerSymbol using the image of a pushpin. By default, the center of the image will be used as the anchor to center the image at the map location. However, if you wanted the needle of the pushpin to end at the map location, you would need to offset the image appropriately to make the needle's end coincide with the map location.

Since
100

§ outlineColor

- (AGSColor*) outlineColor
readwritenonatomicstrong

Color for the outline of the text.

See also
outlineWidth
Since
100

§ outlineWidth

- (CGFloat) outlineWidth
readwritenonatomicassign

Width of the text outline.

See also
outlineColor
Since
100

§ size

- (CGFloat) size
readwritenonatomicassign

Size of the text

Since
100

§ text

- (NSString*) text
readwritenonatomiccopy

Text to display

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

§ verticalAlignment

- (AGSVerticalAlignment) verticalAlignment
readwritenonatomicassign

Vertical alignment of the text

Since
100