ArcGIS Runtime SDK for iOS: AGSPictureFillSymbol Class Reference
ArcGIS Runtime SDK for iOS  100.14
AGSPictureFillSymbol Class Reference

Description

Uses an image to symbolize the fill for a polygon AGSGeoElement.

Supported image formats are BMP, GIF, ICO, JPEG, and PNG. Animated GIF is not supported.

Since
100
Inheritance diagram for AGSPictureFillSymbol:
AGSFillSymbol <AGSLoadable> <AGSRemoteResource> AGSSymbol AGSObject <AGSJSONSerializable>

Instance Methods

(void) - cancelLoad
 
(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) - initWithImage:
 
(instancetype) - initWithURL:
 
(BOOL) - isEqualToSymbol:
 
(void) - loadWithCompletion:
 
(void) - retryLoadWithCompletion:
 
(nullable id) - toJSON:
 
(AGSMultilayerPolygonSymbol *) - toMultilayerSymbol
 

Class Methods

(nullable id< AGSJSONSerializable >) + fromJSON:error:
 
(instancetype) + pictureFillSymbolWithImage:
 
(instancetype) + pictureFillSymbolWithURL:
 

Properties

double angle
 
AGSColorcolor
 
AGSCredentialcredential
 
CGFloat height
 
AGSImageimage
 
NSError * loadError
 
AGSLoadStatus loadStatus
 
float opacity
 
AGSLineSymboloutline
 
AGSRequestConfigurationrequestConfiguration
 
double scaleX
 
double scaleY
 
NSDictionary< NSString *, id > * unknownJSON
 
NSDictionary< NSString *, id > * unsupportedJSON
 
NSURL * URL
 
CGFloat width
 

Method Documentation

◆ cancelLoad

- (void) cancelLoad
requiredinherited

Cancels loading if it is in progress, otherwise it does nothing. This should be called carefully because other objects could be waiting for loadWithCompletion: or retryLoadWithCompletion: to complete and this will call them all back with the error of NSUserCancelledError

Since
100

◆ createSwatchWithBackgroundColor:screen:completion:

- (id<AGSCancelable>) createSwatchWithBackgroundColor: (nullable AGSColor *)  backgroundColor
screen: (nullable AGSScreen *)  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.
completionA block that is invoked when the operation completes.
Since
100

◆ createSwatchWithCompletion:

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

Creates a swatch with a clear 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 AGSScreen *)  screen
backgroundColor: (nullable AGSColor *)  backgroundColor
completion: (void(^)(AGSImage *__nullable swatch, NSError *__nullable error))  completion 

Creates a swatch using the 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
geometryThe geometry of the symbol to be drawn in the swatch image. The specified geometry is in DIPs, with the point {0,0} located at the center of the swatch image. The X-axis increases towards the right side of the swatch image. The Y-axis increases towards the top of the swatch image. For example: when creating a swatch for an AGSMarkerSymbol, specifying a geometry of {10,10} will draw the marker 10 DIPs up and to the right of the center of the swatch. The geometry type (AGSPoint, AGSPolyline, AGSPolygon) should correspond to the symbol type (AGSMarkerSymbol, AGSLineSymbol, AGSFillSymbol). The geometry's spatial reference is ignored.
widthDesired width of the image in pixels.
heightDesired height of the image in pixels.
screenThe screen that the swatch will be rendered for. If you specify nil then the main screen will be used.
backgroundColorThe desired background color of the image.
completionA block that is invoked when operation completes.
Since
100

◆ createSwatchWithWidth:height:screen:backgroundColor:completion:

- (nullable id<AGSCancelable>) createSwatchWithWidth: (NSInteger)  width
height: (NSInteger)  height
screen: (nullable AGSScreen *)  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

◆ initWithImage:

- (instancetype) initWithImage: (AGSImage *)  image

Initializes a picture fill symbol with the provided image. Supported image formats are BMP, GIF, ICO, JPEG, and PNG. Animated GIF is not supported.

Parameters
imageto use with the symbol.
Since
100

◆ initWithURL:

- (instancetype) initWithURL: (NSURL *)  URL

Initializes a picture fill symbol with the provided URL to an image. Supported image formats are BMP, GIF, ICO, JPEG, and PNG. Animated GIF is not supported.

Parameters
URLto an image.
Since
100

◆ isEqualToSymbol:

- (BOOL) isEqualToSymbol: (AGSSymbol *)  other

Compares this symbol to another for equality.

Parameters
otherThe other symbol to compare this one to.
Returns
YES if the two symbols are equal, otherwise NO.
Since
100

◆ loadWithCompletion:

- (void) loadWithCompletion: (nullable void(^)(NSError *__nullable error))  completion
requiredinherited

Loads data for the object asynchronously. The completion block is invoked upon completion.

You can call this method any number of times, however only one attempt is made to load the data. If it is already loading, it will just continue to load (i.e. not force a reload). If it has already loaded successfully, the completion block will be invoked right away. If it has already failed to load, the completion block will be invoked right away with error previously encountered. This method supports multiple callers and will call them all back on completion. However, each caller's completion block will be invoked once and only once.

Parameters
completionblock that is invoked when object loads successfully or fails to load. An error is passed to the block if the object fails to load.
Note
The completion block is always invoked on the main thread.
Since
100
See also
- cancelLoad to cancel loading
- retryLoadWithCompletion: to force reload

◆ pictureFillSymbolWithImage:

+ (instancetype) pictureFillSymbolWithImage: (AGSImage *)  image

Creates a picture fill symbol with the provided image. Supported image formats are BMP, GIF, ICO, JPEG, and PNG. Animated GIF is not supported.

Parameters
imageto use with the symbol.
Returns
A new picture fill symbol.
Since
100

◆ pictureFillSymbolWithURL:

+ (instancetype) pictureFillSymbolWithURL: (NSURL *)  URL

Creates a picture fill symbol with the provided URL to an image. Supported image formats are BMP, GIF, ICO, JPEG, and PNG. Animated GIF is not supported.

Parameters
URLto an image.
Returns
A new picture fill symbol.
Since
100

◆ retryLoadWithCompletion:

- (void) retryLoadWithCompletion: (nullable void(^)(NSError *__nullable error))  completion
requiredinherited

Tries to reload when an object has failed to load. This method should be called judiciously. It should be called when:

  1. you didn't have network connectivity earlier when it failed and you want to retry now that you have connectivity
  2. the server was down earlier when it failed and you want to retry
  3. the request is taking too long and you want to cancel it and retry, in which case you will first call cancelLoad and then this method

If the data hasn't started loading, it will start loading. If it is already loading, it will just continue to load. If it has already loaded successfully, calls back right away. If it has already failed to load, tries again. This method supports multiple callers and will call them all back on completion. However, each caller's completion block will be invoked once and only once.

Parameters
completionblock that is invoked when object loads successfully or fails to load. An error is passed to the block if the object fails to load.
Note
The completion block is always invoked on the main thread.
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.

◆ toMultilayerSymbol

- (AGSMultilayerPolygonSymbol *) toMultilayerSymbol

Gets the multilayer polygon symbol generated from picture fill symbol.

Returns
An AGSMultilayerPolygonSymbol object.
Since
100.13

Property Documentation

◆ angle

- (double) angle
readwritenonatomicassign

Angle of the symbol.

Since
100.1

◆ color

- (AGSColor*) color
readwritenonatomicstronginherited

Color to fill the interior of the polygon feature or graphic

Since
100

◆ credential

- (AGSCredential*) credential
readwritenonatomicstronginherited

Security credentials to access the remote resource. Only applicable if the resource is secured.

Since
100

◆ height

- (CGFloat) height
readwritenonatomicassign

The height (in points, not pixels) of the symbol. Defaults to size of the image.

Since
100

◆ image

- (AGSImage*) image
readnonatomicstrong

The image being used by the picture fill symbol. May be nil until loadStatus is AGSLoadStatusLoaded.

Since
100

◆ loadError

- (NSError*) loadError
readnonatomicstronginherited

The error that was encountered during the most recent load operation. Will be nil if the operation succeeded.

Since
100

◆ loadStatus

- (AGSLoadStatus) loadStatus
readrequirednonatomicassigninherited

Status of the load operation.

Since
100

◆ opacity

- (float) opacity
readwritenonatomicassign

Opacity of the symbol. Defaults to 1 (fully opaque). Permitted values range between 0 - 1 (both inclusive).

Since
100

◆ outline

- (AGSLineSymbol*) outline
readwritenonatomicstronginherited

Outline for the fill symbol

Since
100

◆ requestConfiguration

- (AGSRequestConfiguration*) requestConfiguration
readwritenonatomicstronginherited

The AGSRequestConfiguration object which defines the behavior and policies to use when accessing the remote resource. The default will be nil. If it is nil the [AGSRequestConfiguration globalConfiguration] will be used.

Since
100

◆ scaleX

- (double) scaleX
readwritenonatomicassign

The X scale of the symbol.

Since
100.1

◆ scaleY

- (double) scaleY
readwritenonatomicassign

The Y scale of the symbol.

Since
100.1

◆ 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

◆ URL

- (NSURL*) URL
readrequirednonatomicstronginherited

The URL of the remote resource.

Since
100

◆ width

- (CGFloat) width
readwritenonatomicassign

The width (in points, not pixels) of the symbol. Defaults to size of the image.

Since
100