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

Description

Information about an individual layer or table in a dynamic ArcGIS Map Service.

AGSArcGISMapImageLayer displays maps from an ArcGIS map server. Each layer in the underlying map service is represented by an AGSArcGISSublayer. You can control the visibility and symbols of sublayers and filter data with layer definition expressions.

You can get this object from AGSArcGISMapImageLayer::mapImageSublayers once the map image layer is loaded or you can get a collection of handles from another map image sublayer by using AGSArcGISSublayer::sublayers. You can also create a new sublayer from initWithID: (AGSArcGISMapImageSublayer).

See also
AGSArcGISSublayer, AGSArcGISMapImageLayer::mapImageSublayers, AGSArcGISSublayer::sublayers, - initWithID: (AGSArcGISMapImageSublayer)
Since
100
Inheritance diagram for AGSArcGISMapImageSublayer:
AGSArcGISSublayer AGSLoadableBase <AGSLayerContent> <AGSPopupSource> AGSObject <AGSLoadable>

Instance Methods

(void) - cancelLoad
 
(void) - doCancelLoading
 
(void) - doStartLoading:
 
(id< AGSCancelable >) - fetchLegendInfosWithCompletion:
 
(instancetype) - initWithID:
 
(instancetype) - initWithID:source:
 
(BOOL) - isVisibleAtScale:
 
(void) - loadDidFinishWithError:
 
(void) - loadWithCompletion:
 
(void) - onLoadStatusChanged
 
(void) - retryLoadWithCompletion:
 

Class Methods

(instancetype) + ArcGISMapImageSublayerWithID:
 
(instancetype) + ArcGISMapImageSublayerWithID:source:
 

Properties

BOOL canChangeVisibility
 
NSString * definitionExpression
 
NSMutableArray< AGSLabelDefinition * > * labelDefinitions
 
BOOL labelsEnabled
 
NSError * loadError
 
AGSLoadStatus loadStatus
 
AGSArcGISMapServiceSublayerInfomapServiceSublayerInfo
 
double maxScale
 
double minScale
 
NSString * name
 
float opacity
 
AGSPopupDefinitionpopupDefinition
 
BOOL popupEnabled
 
AGSRendererrenderer
 
BOOL scaleSymbols
 
BOOL showInLegend
 
AGSSublayerSourcesource
 
NSArray< id< AGSLayerContent > > * subLayerContents
 
void(^ subLayerContentsChangedHandler )(void)
 
NSInteger sublayerID
 
NSMutableArray< AGSArcGISSublayer * > * sublayers
 
AGSServiceFeatureTabletable
 
BOOL visible
 
BOOL visibleByDefault
 

Method Documentation

◆ ArcGISMapImageSublayerWithID:

+ (instancetype) ArcGISMapImageSublayerWithID: (NSInteger)  ID

Initialize this sublayer with an ID

Parameters
IDof the sublayer in the ArcGIS Map Service
Returns
Initialized map image sublayer
Since
100

◆ ArcGISMapImageSublayerWithID:source:

+ (instancetype) ArcGISMapImageSublayerWithID: (NSInteger)  ID
source: (AGSSublayerSource *)  source 

Initialize this sublayer with an ID and a source

Note
Only map services that support dynamic layers (AGSArcGISMapServiceInfo::supportsDynamicLayers) will be able to handle sublayers with sources
Parameters
IDof the sublayer
sourcedefining the data for the sublayer
Returns
Initialized map image sublayer
Since
100.1

◆ 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

◆ doCancelLoading

- (void) doCancelLoading

Never call this method directly. The framework calls this method on a background thread when cancelLoad (AGSLoadable-p) is called. It is meant to be overriden by subclasses. Subclasses should override this method to cancel loading their data and call loadDidFinishWithError: (AGSLoadableBase(ForSubclassEyesOnly)) at the end passing in an error representing NSUserCancelledError.

Since
100

Provided by category AGSLoadableBase(ForSubclassEyesOnly).

◆ doStartLoading:

- (void) doStartLoading: (BOOL)  retrying

Never call this method directly. The framework calls this method on a background thread when loadWithCompletion: (AGSLoadable-p) or retryLoadWithCompletion: (AGSLoadable-p) is called. It is meant to be overriden by subclasses. Subclasses should override this method to load their data and call loadDidFinishWithError: (AGSLoadableBase(ForSubclassEyesOnly)) upon completion, passing in the error if any.

Parameters
retryingflag that is true if this method was called from retryLoadWithCompletion: (AGSLoadable-p).
Since
100

Provided by category AGSLoadableBase(ForSubclassEyesOnly).

◆ fetchLegendInfosWithCompletion:

- (id<AGSCancelable>) fetchLegendInfosWithCompletion: (void(^)(NSArray< AGSLegendInfo * > *__nullable legendInfos, NSError *__nullable error))  completion

Fetches the array of legend infos (AGSLegendInfo) for this layer.

Since
100

◆ initWithID:

- (instancetype) initWithID: (NSInteger)  ID

Initialize this sublayer with an ID

Parameters
IDof the sublayer in the ArcGIS Map Service
Returns
Initialized map image sublayer
Since
100

◆ initWithID:source:

- (instancetype) initWithID: (NSInteger)  ID
source: (AGSSublayerSource *)  source 

Initialize this sublayer with an ID and a source

Note
Only map services that support dynamic layers (AGSArcGISMapServiceInfo::supportsDynamicLayers) will be able to handle sublayers with sources
Parameters
IDof the sublayer
sourcedefining the data for the sublayer
Returns
Initialized map image sublayer
Since
100.1

◆ isVisibleAtScale:

- (BOOL) isVisibleAtScale: (double)  scale

Check whether this layer is visible at a given scale.

Since
100

◆ loadDidFinishWithError:

- (void) loadDidFinishWithError: (nullable NSError *)  error

Only subclasses should call this method in doStartLoading: (AGSLoadableBase(ForSubclassEyesOnly)) and doCancelLoading (AGSLoadableBase(ForSubclassEyesOnly)) when done loading or failed to load.

Since
100

Provided by category AGSLoadableBase(ForSubclassEyesOnly).

◆ 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

◆ onLoadStatusChanged

- (void) onLoadStatusChanged

Never call this method directly. The framework calls this method on a background thread when AGSLoadable::loadStatus changes is called. Subclasses can optionally implement this to know when their loading status has changed.

Since
100

Provided by category AGSLoadableBase(ForSubclassEyesOnly).

◆ 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

Property Documentation

◆ canChangeVisibility

- (BOOL) canChangeVisibility
readrequirednonatomicassigninherited

Denotes whether the layer can change visibility or not.

Since
100

◆ definitionExpression

- (NSString*) definitionExpression
readwritenonatomiccopy

The map image sublayer's definition expression. The definition expression string uses the SQL-92 where clause syntax (https://en.wikipedia.org/wiki/SQL-92). Be sure to escape special characters in the expression string as required for your platform. The DATE keyword expects the date format yyyy-mm-dd and the TIMESTAMP keyword expects the time stamp format yyyy-mm-dd hh:mm:ss. See the ArcGIS Blog article entitled "Querying Feature Services Date-Time Queries" (https://www.esri.com/arcgis-blog/products/api-rest/data-management/querying-feature-services-date-time-queries/) for more information.

Since
100.1

◆ labelDefinitions

- (NSMutableArray<AGSLabelDefinition*>*) labelDefinitions
readnonatomicstrong

Defines how labels should be displayed.

Since
100.1

◆ labelsEnabled

- (BOOL) labelsEnabled
readwritenonatomicassign

Specifies whether labels should be displayed for this sublayer.

Since
100.1

◆ 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

◆ mapServiceSublayerInfo

- (AGSArcGISMapServiceSublayerInfo*) mapServiceSublayerInfo
readnonatomicstronginherited

Information about the source this sublayer originates from.

Since
100.1

◆ maxScale

- (double) maxScale
readwritenonatomicassign

The maximum scale at which this sublayer is visible. If the map is zoomed in beyond this scale, the sublayer will not be visible.

Since
100

◆ minScale

- (double) minScale
readwritenonatomicassign

The minimum scale at which this sublayer is visible. If the map is zoomed out beyond this scale, the sublayer will not be visible.

Since
100

◆ name

- (NSString*) name
readwritenonatomiccopy

The sublayer's name.

Since
100.1

◆ opacity

- (float) opacity
readwritenonatomicassign

The opacity of this sublayer as a value between 0 (fully transparent) and 1 (fully opaque).

Since
100.1

◆ popupDefinition

- (AGSPopupDefinition*) popupDefinition
readwritenonatomicstronginherited

The AGSPopupDefinition associated with the popup source. This property will be nil if an error occurs or if the popup source is not associated with a popup definition.

Since
100

◆ popupEnabled

- (BOOL) popupEnabled
readwriterequirednonatomicassigninherited

Indicates whether popups are enabled on this source.

Since
100

◆ renderer

- (AGSRenderer*) renderer
readwritenonatomicstrong

The renderer specifying how the features should be symbolized

Since
100.1

◆ scaleSymbols

- (BOOL) scaleSymbols
readwritenonatomicassign

Specifies whether the symbols for this sublayer are tied to a scale and should resized as the scale varies.

Since
100.1

◆ showInLegend

- (BOOL) showInLegend
readwritenonatomicassigninherited

Indicates whether to show legend information.

Since
100

◆ source

- (AGSSublayerSource*) source
readnonatomicstrong

The source of the data for this sublayer. Only applicable if this sublayer was created with a source based on dynamic layer capabilities of the service.

See also
- initWithID:source:
Since
100.1

◆ subLayerContents

- (NSArray<id<AGSLayerContent> >*) subLayerContents
readnonatomiccopyinherited

This layer's sub-layers.

Since
100

◆ subLayerContentsChangedHandler

- (void(^ subLayerContentsChangedHandler) (void))
readwritenonatomiccopyinherited

Block that is invoked when the sub layer contents changes.

Note
The block will be invoked on the same thread on which the event occured, which could be any arbitrary thread. You need to dispatch any UI related work to the main thread.
Since
100

◆ sublayerID

- (NSInteger) sublayerID
readnonatomicassigninherited

The ID of this sublayer.

Since
100

◆ sublayers

- (NSMutableArray<AGSArcGISSublayer*>*) sublayers
readnonatomicstronginherited

This sublayer's nested (child) sublayers.

Note
This array does not allow duplicate objects.
Since
100

◆ table

- (AGSServiceFeatureTable*) table
readnonatomicstrong

The sublayer's backing table that is used to perform queries or identify features in the sublayer. This property remains nil until the sublayer has been loaded and only applies to sublayers of type "Feature layer" or "Table". See AGSArcGISMapServiceSublayerInfo::sublayerType to find out the type of this sublayer.

Since
100.3

◆ visible

- (BOOL) visible
readwritenonatomicassigninherited

Denotes whether the layer is visible or not. The visibility changes can be monitored using Key-Value Observing (KVO).

Since
100

◆ visibleByDefault

- (BOOL) visibleByDefault
readnonatomicassign

The default visibility of this layer.

Since
100