Class SubtypeFeatureLayer
- java.lang.Object
-
- com.esri.arcgisruntime.layers.Layer
-
- com.esri.arcgisruntime.layers.FeatureLayer
-
- com.esri.arcgisruntime.layers.SubtypeFeatureLayer
-
- All Implemented Interfaces:
TimeAware
,LayerContent
,Loadable
,FloorAware
,PopupSource
public final class SubtypeFeatureLayer extends FeatureLayer
A layer that can visualize feature data with different visibility, rendering, popup properties, and so on for some or all of the subtypes in anArcGISFeatureTable
.The
ArcGISFeatureTable
must have asubtype field
and at least oneFeatureSubtype
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 a
SubtypeFeatureLayer
. Saving a map that contains aSubtypeFeatureLayer
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.
- Since:
- 100.7.0
- See Also:
FeatureLayer
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.esri.arcgisruntime.layers.FeatureLayer
FeatureLayer.RenderingMode, FeatureLayer.SelectionMode
-
-
Constructor Summary
Constructors Constructor Description SubtypeFeatureLayer(ArcGISFeatureTable featureTable)
Creates a new subtype feature layer object.SubtypeFeatureLayer(Item item, long layerId)
Creates a new subtype feature layer object from a feature service portal item.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SubtypeSublayer
getSublayerWithSubtypeCode(java.lang.Object code)
Finds aSubtypeSublayer
for a feature subtype based on the subtype code.SubtypeSublayer
getSublayerWithSubtypeName(java.lang.String name)
Finds aSubtypeSublayer
for a feature subtype based on the subtype name.java.util.List<SubtypeSublayer>
getSubtypeSublayers()
Gets a mutable list ofSubtypeSublayer
s.-
Methods inherited from class com.esri.arcgisruntime.layers.FeatureLayer
addFullTimeExtentChangedListener, clearSelection, copy, getDefinitionExpression, getDisplayFilterDefinition, getFeatureTable, getFloorDefinition, getFullTimeExtent, getLabelDefinitions, getPopupDefinition, getRefreshInterval, getRenderer, getRenderingMode, getSceneProperties, getSelectedFeaturesAsync, getSelectionColor, getSelectionWidth, getTilingMode, getTimeInterval, getTimeOffset, getUnknownJson, getUnsupportedJson, isLabelsEnabled, isPopupEnabled, isScaleSymbols, isTimeFilteringEnabled, isTimeFilteringSupported, removeFullTimeExtentChangedListener, resetFeaturesVisible, resetRenderer, selectFeature, selectFeatures, selectFeaturesAsync, setDefinitionExpression, setDisplayFilterDefinition, setFeaturesVisible, setFeatureVisible, setFloorDefinition, setIsTimeFilteringEnabled, setLabelsEnabled, setPopupDefinition, setPopupEnabled, setRefreshInterval, setRenderer, setRenderingMode, setScaleSymbols, setSelectionColor, setSelectionWidth, setTilingMode, setTimeOffset, unselectFeature, unselectFeatures
-
Methods inherited from class com.esri.arcgisruntime.layers.Layer
addDoneLoadingListener, addLoadStatusChangedListener, addVisibilityChangedListener, cancelLoad, canChangeVisibility, canShowInLegend, fetchLegendInfosAsync, getAttribution, getDescription, getFullExtent, getId, getItem, getLoadError, getLoadStatus, getMaxScale, getMinScale, getName, getOpacity, getSpatialReference, getSubLayerContents, isIdentifyEnabled, isVisible, isVisibleAtScale, loadAsync, removeDoneLoadingListener, removeLoadStatusChangedListener, removeVisibilityChangedListener, retryLoadAsync, setCanShowInLegend, setDescription, setId, setMaxScale, setMinScale, setName, setOpacity, setVisible
-
-
-
-
Constructor Detail
-
SubtypeFeatureLayer
public SubtypeFeatureLayer(ArcGISFeatureTable featureTable)
Creates a new subtype feature layer object. If there are nofeature subtype
objects defined on theArcGISFeatureTable
, the layer will fail to load.- Parameters:
featureTable
- the feature table used as the source of the subtype feature layer- Throws:
java.lang.IllegalArgumentException
- if featureTable is null- Since:
- 100.7.0
-
SubtypeFeatureLayer
public SubtypeFeatureLayer(Item item, long layerId)
Creates a new subtype feature layer object from a feature service portal item.- Parameters:
item
- a feature servicePortalItem
layerId
- the layer id for which to create the layer- Throws:
java.lang.IllegalArgumentException
- if item is null- Since:
- 100.12.0
- See Also:
Layer.getItem()
-
-
Method Detail
-
getSubtypeSublayers
public java.util.List<SubtypeSublayer> getSubtypeSublayers()
Gets a mutable list ofSubtypeSublayer
s. The SubtypeSublayers in this list are the same objects inLayerContent.getSubLayerContents()
. The difference between the two lists is this list is modifiable so the layer order is configurable.- Returns:
- a mutable list of SubtypeSublayers
- Since:
- 100.7.0
-
getSublayerWithSubtypeName
public SubtypeSublayer getSublayerWithSubtypeName(java.lang.String name)
Finds aSubtypeSublayer
for a feature subtype based on the subtype name.- Parameters:
name
- the subtype name of the sublayer to retrieve- Returns:
- the SubtypeSublayer, or null if not found
- Throws:
java.lang.IllegalArgumentException
- if name is null or empty- Since:
- 100.7.0
-
getSublayerWithSubtypeCode
public SubtypeSublayer getSublayerWithSubtypeCode(java.lang.Object code)
Finds aSubtypeSublayer
for a feature subtype based on the subtype code.When working with a particular
ArcGISFeature
, thesubtype code
is the value of theArcGISFeatureLayerInfo.getSubtypeField()
field. The correspondingSubtypeSublayer
can be found using the value of that field. Subtypes can be got from anArcGISFeatureTable
by callingArcGISFeatureTable.getFeatureSubtypes()
.- Parameters:
code
- the subtype code of the sublayer to retrieve- Returns:
- the SubtypeSublayer of the subtype code, or null if not found
- Throws:
java.lang.IllegalArgumentException
- if code is null- Since:
- 100.7.0
-
-