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

Description

A layer that can visualize dimension features data.

Dimension features are a special kind of annotation feature for showing specific lengths or distances on a map. A dimension may indicate the length of a side of a building or land parcel, or the distance between two features, such as a fire hydrant and the corner of a building. They are described in detail in "Dimension".

Each dimension feature has specific text and specific locations for its schematic lines and arrows.

Dimension features are not linked to other point, line, or polygon features, even if the dimension measurement was created to refer to one or more features.

You can construct a dimension layer using a feature table containing dimension features:

Dimension layers can be taken offline from a feature service hosted on ArcGIS Enterprise 10.9 or later, using the AGSGeodatabaseSyncTask. Dimension layers are also supported in mobile map packages or mobile geodatabases created in ArcGIS Pro 2.9 or later.

Dimension respects the reference scale defined by the map, so dimension will always be presented to the user at the correct size and position, as defined by the dimension author.

Dimension features cannot be added, changed, or deleted by Runtime users (attempts will produce a "Geodatabase table not editable" (3016) error).

The fields of a dimension feature can be queried by Runtime users or used in the definition expression, but not have their values changed. The automatic fields are described in detail in "Dimension fields". Authors may have added additional fields relevant to their data description.

The Runtime user does not have access to, and cannot change, the renderer or the styles used for rendering dimensions.

See also
AGSLayer
Since
100.13
Inheritance diagram for AGSDimensionLayer:
AGSLayer <AGSRemoteResource> AGSLoadableBase <AGSLayerContent> AGSObject <AGSLoadable>

Instance Methods

(void) - cancelLoad
 
(void) - clearSelection
 
(void) - doCancelLoading
 
(void) - doStartLoading:
 
(id< AGSCancelable >) - fetchLegendInfosWithCompletion:
 
(instancetype) - initWithFeatureTable:
 
(instancetype) - initWithItem:serviceLayerID:
 
(instancetype) - initWithURL:
 
(BOOL) - isEqualToLayer:
 
(BOOL) - isVisibleAtScale:
 
(void) - loadDidFinishWithError:
 
(void) - loadWithCompletion:
 
(void) - onLoadStatusChanged
 
(void) - resetFeaturesVisible
 
(void) - retryLoadWithCompletion:
 
(id< AGSCancelable >) - selectedFeaturesWithCompletion:
 
(void) - selectFeature:
 
(void) - selectFeatures:
 
(id< AGSCancelable >) - selectFeaturesWithParameters:mode:completion:
 
(void) - setFeaturesVisibleWithFeatures:visible:
 
(void) - setFeatureVisibleWithFeature:visible:
 
(void) - unselectFeature:
 
(void) - unselectFeatures:
 

Class Methods

(instancetype) + dimensionLayerWithFeatureTable:
 
(instancetype) + dimensionLayerWithItem:serviceLayerID:
 
(instancetype) + dimensionLayerWithURL:
 

Properties

NSString * attribution
 
AGSLabelBarrierWeight barrierWeight
 
BOOL canChangeVisibility
 
AGSCredentialcredential
 
NSString * definitionExpression
 
AGSArcGISFeatureTablefeatureTable
 
AGSEnvelopefullExtent
 
BOOL identifyEnabled
 
AGSItemitem
 
NSString * layerDescription
 
NSString * layerID
 
NSError * loadError
 
AGSLoadStatus loadStatus
 
double maxScale
 
double minScale
 
NSString * name
 
float opacity
 
double referenceScale
 
AGSRequestConfigurationrequestConfiguration
 
NSInteger serviceLayerID
 
BOOL showInLegend
 
AGSSpatialReferencespatialReference
 
NSArray< id< AGSLayerContent > > * subLayerContents
 
void(^ subLayerContentsChangedHandler )(void)
 
NSURL * URL
 
BOOL visible
 

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

◆ clearSelection

- (void) clearSelection

Updates any selected features in the layer back to the un-selected state.

Since
100.13

◆ dimensionLayerWithFeatureTable:

+ (instancetype) dimensionLayerWithFeatureTable: (AGSArcGISFeatureTable *)  featureTable

Creates a dimension layer object from a feature table containing dimension features.

If the feature table does not contain dimension data then the dimension layer will fail to load. AGSArcGISFeatureTable::layerInfo and AGSArcGISFeatureLayerInfo::serviceType can be checked, to verify the feature type, before attempting to create a layer.

Parameters
featureTableThe feature table, containing dimension features, used as the source of the dimension layer.
See also
AGSArcGISFeatureTable
Since
100.13

◆ dimensionLayerWithItem:serviceLayerID:

+ (instancetype) dimensionLayerWithItem: (AGSItem *)  item
serviceLayerID: (NSInteger)  serviceLayerID 

Creates a new dimension layer object from a feature service portal item.

Parameters
itemA feature service item.
serviceLayerIDThe service layer ID for which to create the layer.
See also
AGSLayer::item
Since
100.13

◆ dimensionLayerWithURL:

+ (instancetype) dimensionLayerWithURL: (NSURL *)  URL

Creates a new dimension layer from a feature service URL.

If the specified URL is not a valid feature service endpoint, then it will fail to load.

Parameters
URLThe URL to the feature service layer.
Since
100.13

◆ 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

◆ initWithFeatureTable:

- (instancetype) initWithFeatureTable: (AGSArcGISFeatureTable *)  featureTable

Creates a dimension layer object from a feature table containing dimension features.

If the feature table does not contain dimension data then the dimension layer will fail to load. AGSArcGISFeatureTable::layerInfo and AGSArcGISFeatureLayerInfo::serviceType can be checked, to verify the feature type, before attempting to create a layer.

Parameters
featureTableThe feature table, containing dimension features, used as the source of the dimension layer.
See also
AGSArcGISFeatureTable
Since
100.13

◆ initWithItem:serviceLayerID:

- (instancetype) initWithItem: (AGSItem *)  item
serviceLayerID: (NSInteger)  serviceLayerID 

Creates a new dimension layer object from a feature service portal item.

Parameters
itemA feature service item.
serviceLayerIDThe service layer ID for which to create the layer.
See also
AGSLayer::item
Since
100.13

◆ initWithURL:

- (instancetype) initWithURL: (NSURL *)  URL

Creates a new dimension layer from a feature service URL.

If the specified URL is not a valid feature service endpoint, then it will fail to load.

Parameters
URLThe URL to the feature service layer.
Since
100.13

◆ isEqualToLayer:

- (BOOL) isEqualToLayer: (AGSLayer *)  other

◆ 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).

◆ resetFeaturesVisible

- (void) resetFeaturesVisible

Resets the visibility of the layer's features back to the original visibility when loaded from the data source.

Since
100.13

◆ 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

◆ selectedFeaturesWithCompletion:

- (id<AGSCancelable>) selectedFeaturesWithCompletion: (void(^)(AGSFeatureQueryResult *_Nullable result, NSError *_Nullable error))  completion

Returns a list of the currently selected features.

Parameters
completionA block that is invoked when the operation finishes. The result parameter is populated if the operation completed successfully, otherwise the error parameter is populated.
Returns
An operation which can be canceled.
Since
100.13

◆ selectFeature:

- (void) selectFeature: (AGSFeature *)  feature

Selects the given feature and adds it to the current list of selected features.

Parameters
featureThe feature.
Since
100.13

◆ selectFeatures:

- (void) selectFeatures: (NSArray< AGSFeature * > *)  features

Selects the features in the list and adds them to the current list of selected features.

Parameters
featuresAn array of AGSFeature objects.
Since
100.13

◆ selectFeaturesWithParameters:mode:completion:

- (id<AGSCancelable>) selectFeaturesWithParameters: (AGSQueryParameters *)  parameters
mode: (AGSSelectionMode mode
completion: (void(^)(AGSFeatureQueryResult *_Nullable result, NSError *_Nullable error))  completion 

Selects the features that match the criteria in the AGSQueryParameters object and adds them to the current list of selected features.

Parameters
parametersThe definition of the query to submit to the feature table.
modeDefines how the list of currently selected features will be updated with the features returned from the query.
completionA block that is invoked when the operation finishes. The result parameter is populated if the operation completed successfully, otherwise the error parameter is populated.
Returns
An operation which can be canceled.
Since
100.13

◆ setFeaturesVisibleWithFeatures:visible:

- (void) setFeaturesVisibleWithFeatures: (NSArray< AGSFeature * > *)  features
visible: (BOOL)  visible 

Sets the visibility of the given features.

Parameters
featuresAn array of AGSFeature objects.
visibleYES to show, otherwise NO to hide.
Since
100.13

◆ setFeatureVisibleWithFeature:visible:

- (void) setFeatureVisibleWithFeature: (AGSFeature *)  feature
visible: (BOOL)  visible 

Sets the visibility of the given feature.

Parameters
featureThe feature whose visibility should be set.
visibleYES to show, otherwise NO to hide.
Since
100.13

◆ unselectFeature:

- (void) unselectFeature: (AGSFeature *)  feature

Unselects the given feature and removes it from the current list of selected features.

Parameters
featureThe feature that should be unselected.
Since
100.13

◆ unselectFeatures:

- (void) unselectFeatures: (NSArray< AGSFeature * > *)  features

Unselects the features in the given array and removes them from the array of selected features.

Parameters
featuresAn array of AGSFeature objects.
Since
100.13

Property Documentation

◆ attribution

- (NSString*) attribution
readnonatomiccopyinherited

Attribution information of the layer.

Since
100

◆ barrierWeight

- (AGSLabelBarrierWeight) barrierWeight
readwritenonatomicassign

The weight of dimension features when considered as barriers to labeling. The default is AGSLabelBarrierWeightHigh.

Since
100.14

◆ canChangeVisibility

- (BOOL) canChangeVisibility
readrequirednonatomicassigninherited

Denotes whether the layer can change visibility or not.

Since
100

◆ credential

- (AGSCredential*) credential
readwritenonatomicstronginherited

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

Since
100

◆ definitionExpression

- (NSString*) definitionExpression
readwritenonatomiccopy

An expression which is a SQL statement where clause to specify the subset of features to be displayed.

The definition expression string uses the SQL-92 where clause syntax (https://en.wikipedia.org/wiki/SQL-92). The default value is an empty string, which will allow all dimension features in the data source to be used by the AGSDimensionLayer.

Warning
: 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" for more information.
Since
100.13

◆ featureTable

- (AGSArcGISFeatureTable*) featureTable
readnonatomicstrong

The feature table associated with this layer.

Since
100.13

◆ fullExtent

- (AGSEnvelope*) fullExtent
readnonatomicstronginherited

Full extent of the layer.

Since
100

◆ identifyEnabled

- (BOOL) identifyEnabled
readnonatomicassigninherited

Specifies whether the layer supports identify.

Since
100

◆ item

- (AGSItem*) item
readnonatomicstronginherited

The item the layer has been created from.

Since
100

◆ layerDescription

- (NSString*) layerDescription
readwritenonatomiccopyinherited

The layer's description.

Since
100

◆ layerID

- (NSString*) layerID
readwritenonatomiccopyinherited

The layer's ID specified in the web map item of ArcGIS Online or an on-premises portal.

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

◆ maxScale

- (double) maxScale
readwritenonatomicassigninherited

The maximum scale at which this layer is visible. If the map or scene is zoomed in beyond this scale, the layer will not be visible. A value of 0 means there is no maximum scale threshold and the layer will be visible at the smallest scale available for the map or scene.

Since
100

◆ minScale

- (double) minScale
readwritenonatomicassigninherited

The minimum scale at which this layer is visible. If the map or scene is zoomed out. beyond this scale, the layer will not be visible. A value of 0 means there is no minimum scale threshold and the layer will be visible at the largest scale available for the map or scene.

Since
100

◆ name

- (NSString*) name
readwritenonatomiccopyinherited

The name of the layer.

Since
100

◆ opacity

- (float) opacity
readwritenonatomicassigninherited

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

Since
100

◆ referenceScale

- (double) referenceScale
readnonatomicassign

The reference scale for the layer.

The reference scale of the layer is the scale at which a client should view the layer for the schematic lines and text to appear at its authored size.

If the client changes the viewing scale, then the schematic lines and text will grow or shrink to keep a consistent size on the map (not the screen).

For a valid layer, the reference scale will always be a finite value, greater than zero. Until the layer is loaded, the reference scale will be zero.

Since
100.13

◆ 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

◆ serviceLayerID

- (NSInteger) serviceLayerID
readnonatomicassign

The service layer ID that defines the layer within the feature service portal item.

See also
AGSLayer::item, AGSDimensionLayer::serviceLayerID
Since
100.13

◆ showInLegend

- (BOOL) showInLegend
readwritenonatomicassigninherited

Indicates whether to show legend information.

Since
100

◆ spatialReference

- (AGSSpatialReference*) spatialReference
readnonatomicstronginherited

The spatial reference of the layer.

Since
100

◆ 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 occurred, which could be any arbitrary thread. You need to dispatch any UI related work to the main thread.
Since
100

◆ URL

- (NSURL*) URL
readrequirednonatomicstronginherited

The URL of the remote resource.

Since
100

◆ 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