ArcGIS Runtime SDK for iOS
100.15
|
A layer that can visualize feature data with different visibility, rendering, popup properties, and so on for some or all of the subtypes in an AGSArcGISFeatureTable
.
The AGSArcGISFeatureTable
must have an AGSArcGISFeatureLayerInfo::subtypeField
and at least one AGSFeatureSubtype
defined, otherwise the layer will fail to load.
Subtypes provide a way to organize your data within an ArcGIS feature table. For example, the streets in a city streets feature table could be categorized into three subtypes - local streets, collector streets, and arterial streets. The benefit of the subtype feature layer is that it allows you to configure different layer properties per subtype. This is particularly useful for data, such as utility networks, in which many different network elements are grouped into a single subtype feature layer.
Functional characteristics:
The subtype feature layer acts like a group layer that automatically creates one feature layer, or subtype sublayer, for each subtype in the table. Each subtype sublayer can be configured independently of one another. They can have different renderers, label definitions, max and min scales, visibility, layer order in the map, and so on. When a subtype group layer is read from a web map or mobile map, it is represented as an AGSSubtypeFeatureLayer
object. Saving a map that contains an AGSSubtypeFeatureLayer
object will save the layer as a subtype group layer. Subtype feature layers are supported in offline maps and will work in offline editing workflows.
Performance characteristics:
Queries are optimized across all sublayers. For example, a pan of the map sends a single request to the feature table to cover all the sublayers. If you had manually created a feature layer for each subtype, this would have resulted in one query per feature layer.
AGSFeatureLayer
, Sample: Display subtype feature layer Instance Methods | |
(void) | - cancelLoad |
(void) | - clearSelection |
(void) | - doCancelLoading |
(void) | - doStartLoading: |
(id< AGSCancelable >) | - fetchLegendInfosWithCompletion: |
(id< AGSCancelable >) | - getSelectedFeaturesWithCompletion: |
(instancetype) | - init |
(instancetype) | - initWithFeatureTable: |
(instancetype) | - initWithFeatureTable: |
(instancetype) | - initWithItem: |
(instancetype) | - initWithItem:layerID: |
(BOOL) | - isEqualToLayer: |
(BOOL) | - isVisibleAtScale: |
(void) | - loadDidFinishWithError: |
(void) | - loadWithCompletion: |
(void) | - onLoadStatusChanged |
(void) | - resetFeaturesVisible |
(void) | - resetRenderer |
(void) | - retryLoadWithCompletion: |
(void) | - selectFeature: |
(void) | - selectFeatures: |
(id< AGSCancelable >) | - selectFeaturesWithQuery:mode:completion: |
(void) | - setFeature:visible: |
(void) | - setFeatures:visible: |
(nullable AGSSubtypeSublayer *) | - sublayerWithCode: |
(nullable AGSSubtypeSublayer *) | - sublayerWithName: |
(void) | - unselectFeature: |
(void) | - unselectFeatures: |
Class Methods | |
(instancetype) | + featureLayer |
(instancetype) | + featureLayerWithFeatureTable: |
(instancetype) | + featureLayerWithItem: |
(instancetype) | + featureLayerWithItem:layerID: |
(instancetype) | + subtypeFeatureLayerWithFeatureTable: |
(instancetype) | + subtypeFeatureLayerWithItem:layerID: |
|
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
- (void) clearSelection |
Clears selection on all features.
- (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
.
Provided by category AGSLoadableBase(ForSubclassEyesOnly).
- (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.
retrying | flag that is true if this method was called from retryLoadWithCompletion: (AGSLoadable-p) . |
Provided by category AGSLoadableBase(ForSubclassEyesOnly).
+ (instancetype) featureLayer |
Creates a new feature layer.
featureLayerWithFeatureTable:
or featureLayerWithItem:layerID:
instead. + (instancetype) featureLayerWithFeatureTable: | (AGSFeatureTable *) | featureTable |
Creates a new feature layer with the given AGSFeatureTable
object. Any of the inherited AGSFeatureTable
types can be used as the input parameter for this initializer, including AGSArcGISFeatureTable
, AGSFeatureCollectionTable
, AGSGeoPackageFeatureTable
, AGSOGCFeatureCollectionTable
, AGSShapefileFeatureTable
and AGSWFSFeatureTable
.
featureTable | The backing dataset whose features need to be drawn on the map by this layer. |
+ (instancetype) featureLayerWithItem: | (AGSItem *) | item |
Creates a new feature layer object from a feature layer or feature service portal item.
If the portal item is a feature service, the AGSFeatureLayer
will be created from the first layer on the service.
item | A feature service or feature layer AGSPortalItem . |
AGSLayer::item
+ (instancetype) featureLayerWithItem: | (AGSItem *) | item | |
layerID: | (NSInteger) | layerID | |
Creates a new feature layer with the provided information.
The feature layer will fail to load if an invalid portal item is passed in. For example, a feature layer portal item.
item | representing an ArcGIS Feature Serivce. The item's type must be AGSPortalItemTypeFeatureService . |
layerID | ID of an individual layer in the ArcGIS Feature service represented by the item . |
- (id<AGSCancelable>) fetchLegendInfosWithCompletion: | (void(^)(NSArray< AGSLegendInfo * > *__nullable legendInfos, NSError *__nullable error)) | completion |
Fetches the array of legend infos (AGSLegendInfo
) for this layer.
- (id<AGSCancelable>) getSelectedFeaturesWithCompletion: | (void(^)(AGSFeatureQueryResult *__nullable featureQueryResult, NSError *__nullable error)) | completion |
Retrieve the list of features that have selection enabled.
completion | A block that is invoked with the results, or an error if one is encountered. |
- (instancetype) init |
Creates a new feature layer.
- (instancetype) initWithFeatureTable: | (AGSArcGISFeatureTable *) | featureTable |
Creates a new subtype feature layer object.
If there are no AGSArcGISFeatureTable::featureSubtypes
objects defined on the AGSArcGISFeatureTable
, the layer will fail to load.
featureTable | The feature table used as the source of the subtype feature layer. |
- (instancetype) initWithFeatureTable: | (AGSFeatureTable *) | featureTable |
Creates a layer with the given AGSFeatureTable
object. Any of the inherited AGSFeatureTable
types can be used as the input parameter for this initializer, including AGSArcGISFeatureTable
, AGSFeatureCollectionTable
, AGSGeoPackageFeatureTable
, AGSOGCFeatureCollectionTable
, AGSShapefileFeatureTable
and AGSWFSFeatureTable
.
featureTable | The backing dataset whose features need to be drawn on the map by this layer. |
- (instancetype) initWithItem: | (AGSItem *) | item |
Creates a new feature layer object from a feature layer or feature service portal item.
If the portal item is a feature service, the AGSFeatureLayer
will be created from the first layer on the service.
item | A feature service or feature layer AGSPortalItem . |
AGSLayer::item
- (instancetype) initWithItem: | (AGSItem *) | item | |
layerID: | (NSInteger) | layerID | |
Creates a new subtype feature layer object from a feature service portal item.
item | A feature service AGSPortalItem . |
layerID | The layer ID for which to create the layer. |
AGSLayer::item
Implements AGSFeatureLayer.
- (BOOL) isEqualToLayer: | (AGSLayer *) | other |
- (BOOL) isVisibleAtScale: | (double) | scale |
Check whether this layer is visible at a given scale.
- (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.
Provided by category AGSLoadableBase(ForSubclassEyesOnly).
|
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.
completion | block that is invoked when object loads successfully or fails to load. An error is passed to the block if the object fails to load. |
- cancelLoad
to cancel loading - retryLoadWithCompletion:
to force reload - (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.
Provided by category AGSLoadableBase(ForSubclassEyesOnly).
- (void) resetFeaturesVisible |
Reset the visibility of all features back to their original state.
- (void) resetRenderer |
Reset the renderer
back to the original renderer provided by the featureTable
. This is useful if you, for instance, change the renderer and then want to revert back to the original.
|
requiredinherited |
Tries to reload when an object has failed to load. This method should be called judiciously. It should be called when:
cancelLoad
and then this methodIf 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.
completion | block that is invoked when object loads successfully or fails to load. An error is passed to the block if the object fails to load. |
- (void) selectFeature: | (AGSFeature *) | feature |
Select the specified feature. The map or scene will be updated to render the feature with selectionColor
.
feature | An array of AGSFeature to select. |
selectionColor
selectFeatures:
to enable selection on a group of features together. It provides better performance as the map will only need to be updated once. - (void) selectFeatures: | (NSArray< AGSFeature * > *) | features |
Select the specified features. The map or scene will be updated to highlight the features with selectionColor
(cyan by default).
features | to select. |
selectionColor
- (id<AGSCancelable>) selectFeaturesWithQuery: | (AGSQueryParameters *) | parameters | |
mode: | (AGSSelectionMode) | mode | |
completion: | (nullable void(^)(AGSFeatureQueryResult *__nullable featureQueryResult, NSError *__nullable error)) | completion | |
Select features that match the query criteria. The map or scene will be updated to highlight the features with selectionColor
(cyan by default).
parameters | A parameters object defining which features should be considered. |
mode | A mode defining how selection needs to be applied to the features. |
completion | A block that is invoked with the results, or an error if one is encountered. |
- (void) setFeature: | (AGSFeature *) | feature | |
visible: | (BOOL) | visible | |
Change the visibility of the specified feature. The map or scene is redrawn to reflect the change.
feature | to change. |
visible | If YES , feature is made visible. If NO , feature is hidden. |
setFeatures:visible:
to change the visibility of a group of features together. It provides better performance as the map will only need to be updated once. - (void) setFeatures: | (NSArray< AGSFeature * > *) | features | |
visible: | (BOOL) | visible | |
Change the visibility of the specified features. The map or scene is updated to reflect the change.
features | An array of AGSFeature to change visibility. |
visible | If YES , features are made visible. If NO , features are hidden. |
- (nullable AGSSubtypeSublayer *) sublayerWithCode: | (id) | code |
Finds an AGSSubtypeSublayer
object for a feature subtype based on the AGSFeatureSubtype::code
property. When working with a particular AGSArcGISFeature
, the AGSFeatureSubtype::code
property is the value of the AGSArcGISFeatureLayerInfo::subtypeField
. The corresponding AGSSubtypeSublayer
can be found using the value of that field.
code | The subtype code of the sublayer to retrieve. |
AGSSubtypeSublayer
of the subtype code. - (nullable AGSSubtypeSublayer *) sublayerWithName: | (NSString *) | name |
Finds an AGSSubtypeSublayer
for a feature subtype based on the subtype name.
name | The subtype name of the sublayer to retrieve. |
AGSSubtypeSublayer
of the subtype name. + (instancetype) subtypeFeatureLayerWithFeatureTable: | (AGSArcGISFeatureTable *) | featureTable |
Creates a new subtype feature layer object.
If there are no AGSArcGISFeatureTable::featureSubtypes
objects defined on the AGSArcGISFeatureTable
, the layer will fail to load.
featureTable | The feature table used as the source of the subtype feature layer. |
+ (instancetype) subtypeFeatureLayerWithItem: | (AGSItem *) | item | |
layerID: | (NSInteger) | layerID | |
Creates a new subtype feature layer object from a feature service portal item.
item | A feature service AGSPortalItem . |
layerID | The layer ID for which to create the layer. |
AGSLayer::item
- (void) unselectFeature: | (AGSFeature *) | feature |
Clear selection on the specified feature. The map or scene will be redrawn to reflect the change.
feature | to unselect. |
unselectFeatures:
to disable selection on a group of features together. It provides better performance as the map will only need to be updated once. - (void) unselectFeatures: | (NSArray< AGSFeature * > *) | features |
Clear selection on the specified features. The map or scene will be redrawn to reflect the change.
features | An array of AGSFeature to unselect. |
|
readnonatomiccopyinherited |
Attribution information of the layer.
|
readrequirednonatomicassigninherited |
Denotes whether the layer can change visibility or not.
|
readwritenonatomiccopyinherited |
A SQL expression which limits the features available for query and display on the feature layer.
The definition expression string that is used as the AGSFeatureLayer::definitionExpression
should follow standard SQL syntax similar to what is discussed in the document SQL reference for query expressions used in ArcGIS.
|
readwritenonatomicstronginherited |
Defines how features are filtered from the display.
Use this property to declutter the feature display. Since this only affects the display, features filtered by the AGSFeatureLayer::displayFilterDefinition
remain available for query, unlike features filtered by AGSFeatureLayer::definitionExpression
.
|
readnonatomicstronginherited |
The backing dataset whose features are drawn on the map by this layer.
|
readwriterequirednonatomicstronginherited |
Defines the properties that allow a layer to be floor-aware.
When a layer is configured as floor-aware, it has an AGSFloorAware::floorDefinition
property that defines properties that allow a layer to be floor-aware. When it is nil
(default value) the specific layer does not support floor filtering.
|
readnonatomicstronginherited |
Full extent of the layer.
|
readnonatomicstronginherited |
The full time extent of the layer 100.2
|
readnonatomicassigninherited |
Specifies whether the layer supports identify.
|
readnonatomicstronginherited |
The item the layer has been created from.
|
readnonatomicstronginherited |
Defines how labels should be displayed.
|
readwritenonatomicassigninherited |
Indicates whether or not features will be labelled on this layer.
|
readwritenonatomiccopyinherited |
The layer's description.
|
readwritenonatomiccopyinherited |
The layer's ID specified in the web map item of ArcGIS Online or an on-premises portal.
|
readnonatomicstronginherited |
The error that was encountered during the most recent load operation. Will be nil if the operation succeeded.
|
readrequirednonatomicassigninherited |
Status of the load operation.
|
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.
|
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.
|
readwritenonatomiccopyinherited |
The name of the layer.
|
readwritenonatomicassigninherited |
The opacity of this layer as a value between 0 (fully transparent) and 1 (fully opaque). Default value is 1.
|
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.
|
readwriterequirednonatomicassigninherited |
Indicates whether popups are enabled on this source.
|
readwritenonatomicassigninherited |
Time interval (in seconds) specifying how often the layer should auto-refresh its contents. If 0 or less is specified, the layer will not auto-refresh.
|
readwritenonatomicstronginherited |
The renderer specifying how the features should be symbolized.
|
readwritenonatomicassigninherited |
Mode used for rendering this layer. Static
mode is better suited for displaying large datasets (in terms of number of vertices) and for complex symbology because it does not update the layer's display while pan/zoom operations are in progress. Dynamic
mode is better suited for smaller datasets that are updating frequently or for more interactive experience as the layer's display is updated continuously while pan/zoom operations are in progress.
AGSLoadSettings
to specify rendering mode for all feature layers in a map or scene.
|
readwritenonatomicassigninherited |
Whether the layer's symbols and labels honor the map reference scale. If the map has a positive reference scale, and the layer honors it, then symbols and labels will be drawn at their specified size when the viewing scale is the same as the reference scale, and will grow or shrink as the view zooms in or out, to keep the symbol a fixed size on the map. If the map has no reference scale, the reference scale is zero or the feature layer's scaleSymbols
property is NO
, then the symbols and labels will be drawn at their fixed screen size.
|
readwritenonatomicstronginherited |
Properties to apply only when rendering data in 3D scenes using an AGSSceneView
object.
|
readwritenonatomicstronginherited |
The color to use for drawing a halo around selected features. Defaults to cyan color.
color
property exposed through AGSGeoView::selectionProperties
.
|
readwritenonatomicassigninherited |
The width (in points) of the selection halo.
|
readwritenonatomicassigninherited |
Indicates whether to show legend information.
|
readnonatomicstronginherited |
The spatial reference of the layer.
|
readnonatomiccopyinherited |
This layer's sub-layers.
|
readwritenonatomiccopyinherited |
Block that is invoked when the sub layer contents changes.
|
readnonatomicstrong |
The mutable collection of AGSSubtypeSublayer
. The objects in this collection are the same objects in AGSLayerContent::subLayerContents
. The difference between the two collections is this collection is modifiable so the layer order is configurable.
|
readnonatomicassigninherited |
Indicates whether the layer supports filtering its contents by a time range 100.2
|
readwritenonatomicassigninherited |
The feature tiling mode in use by the feature layer. Default is AGSFeatureTilingModeEnabledWhenSupported
.
Changes how feature tiling is handled by the feature layer.
AGSFeatureTilingMode
|
readwritenonatomicassigninherited |
Indicates whether the layer must use the time extent defined on the owning AGSGeoView::timeExtent
and filter its content. Only applicable if the layer supports time filtering (see supportsTimeFiltering
) 100.2
|
readnonatomicstronginherited |
Returns the suggested time slider step size for this time aware layer. Can be nil
if no time interval is suggested for this time aware object.
100.2
|
readwritenonatomicstronginherited |
A time offset for this layer. This is useful when data from different layers belong to different time periods and must be displayed together. The offset it applied on-the-fly, it does not change the actual data of the layer. The time offset is subtracted from the time extent set on the owning AGSGeoView::timeExtent
before the extent is used to filter content from the layer. 100.2
|
readnonatomiccopyinherited |
Unknown data from the source JSON. Unknown JSON is a dictionary of values that was in the source JSON but was not parsed by the Runtime.
NSDictionary
|
readnonatomiccopyinherited |
Unsupported data from the source JSON. Unsupported JSON is a dictionary of values that are supported by web maps, but not exposed through the native Runtime API.
NSDictionary
|
readwritenonatomicassigninherited |
Denotes whether the layer is visible or not. The visibility changes can be monitored using Key-Value Observing (KVO).