Class DimensionLayer
- java.lang.Object
 - 
- com.esri.arcgisruntime.layers.Layer
 - 
- com.esri.arcgisruntime.layers.DimensionLayer
 
 
 
- 
- All Implemented Interfaces:
 RemoteResource,LayerContent,Loadable
public final class DimensionLayer extends Layer implements RemoteResource
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:
- 
    An online 
ServiceFeatureTablethat has a feature layer service type ofArcGISFeatureLayerInfo.ServiceType.DIMENSION_LAYER - 
   An offline 
GeodatabaseFeatureTablereturned by theGeodatabase.getGeodatabaseDimensionTables()collection when aGenerateGeodatabaseJobhas completed 
Dimension layers can be taken offline from a feature service hosted on ArcGIS Enterprise 10.9 or later, using the
GeodatabaseSyncTask. 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.
- Since:
 - 100.13.0
 - See Also:
 Layer
 
- 
- 
Constructor Summary
Constructors Constructor Description DimensionLayer(ArcGISFeatureTable featureTable)Creates a dimension layer from a feature table containing dimension features.DimensionLayer(PortalItem item, long layerId)Creates a new dimension layer object from a feature service portal item.DimensionLayer(java.lang.String uri)Creates a new dimension layer from a feature service URI. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearSelection()Updates any selected features in the layer back to the un-selected state.DimensionLayercopy()Creates a deep copy of this DimensionLayer instance.LabelBarrierWeightgetBarrierWeight()Gets the weight of dimension features when considered as barriers to labeling.CredentialgetCredential()Gets theCredentialthat is set on the network-enabled resource.java.lang.StringgetDefinitionExpression()Gets an expression which is a SQL statement where clause to specify the subset of features to be displayed.ArcGISFeatureTablegetFeatureTable()Gets the feature table associated with this layer.longgetLayerId()Gets the layer ID that defines the layer within the feature service portal item.doublegetReferenceScale()Gets the reference scale for the layer.RequestConfigurationgetRequestConfiguration()Gets theRequestConfigurationused to modify the parameters of network requests made by thisRemoteResource.ListenableFuture<FeatureQueryResult>getSelectedFeaturesAsync()Returns a list of the currently selected features.java.lang.StringgetUri()Gets the URI of a feature service to define the layer.voidresetFeaturesVisible()Resets the visibility of the layer's features back to the original visibility when loaded from the data source.voidselectFeature(Feature feature)Selects the given feature and adds it to the current list of selected features.voidselectFeatures(java.lang.Iterable<Feature> features)Selects the features in the list and adds them to the current list of selected features.ListenableFuture<FeatureQueryResult>selectFeaturesAsync(QueryParameters parameters, FeatureLayer.SelectionMode mode)Selects the features that match the criteria in theQueryParametersobject and adds them to the current list of selected features.voidsetBarrierWeight(LabelBarrierWeight barrierWeight)Sets the weight of dimension features when considered as barriers to labeling.voidsetCredential(Credential credential)Sets aCredentialto be used by the network-enabled resource in the event of an authentication challenge.voidsetDefinitionExpression(java.lang.String definitionExpression)Sets an expression which is a SQL statement where clause to specify the subset of features to be displayed.voidsetFeaturesVisible(java.lang.Iterable<Feature> features, boolean visible)Sets the visibility of the given features.voidsetFeatureVisible(Feature feature, boolean visible)Sets the visibility of the given feature.voidsetRequestConfiguration(RequestConfiguration requestConfiguration)Sets theRequestConfigurationused to modify the parameters of network requests made by thisRemoteResource.voidunselectFeature(Feature feature)Unselects the given feature and removes it from the current list of selected features.voidunselectFeatures(java.lang.Iterable<Feature> features)Unselects the features in the given list and removes them from the current list of selected features.- 
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
- 
DimensionLayer
public DimensionLayer(ArcGISFeatureTable featureTable)
Creates a dimension layer from a feature table containing dimension features.If the feature table does not contain dimension data then the DimensionLayer will fail to load.
ArcGISFeatureTable.getLayerInfo()andArcGISFeatureLayerInfo.getServiceType()can be checked, to verify the feature type, before attempting to create aLayer.- Parameters:
 featureTable- the feature table, containing dimension features, used as the source of the dimension layer- Throws:
 java.lang.IllegalArgumentException- if featureTable is null- Since:
 - 100.13.0
 - See Also:
 ArcGISFeatureTable
 
- 
DimensionLayer
public DimensionLayer(PortalItem item, long layerId)
Creates a new dimension layer object from a feature service portal item.- Parameters:
 item- a feature servicePortalItemlayerId- the layer ID for which to create the layer- Throws:
 java.lang.IllegalArgumentException- if item is null- Since:
 - 100.13.0
 - See Also:
 Layer.getItem()
 
- 
DimensionLayer
public DimensionLayer(java.lang.String uri)
Creates a new dimension layer from a feature service URI.If the specified URI is not a valid Feature Service endpoint, then it will fail to load.
- Parameters:
 uri- the URI to the feature service layer- Throws:
 java.lang.IllegalArgumentException- if uri is null or empty- Since:
 - 100.13.0
 
 
 - 
 
- 
Method Detail
- 
getUri
public java.lang.String getUri()
Gets the URI of a feature service to define the layer.- Specified by:
 getUriin interfaceRemoteResource- Returns:
 - the URI of a feature service to define the layer
 - Since:
 - 100.13.0
 
 
- 
getBarrierWeight
public LabelBarrierWeight getBarrierWeight()
Gets the weight of dimension features when considered as barriers to labeling.The default is
LabelBarrierWeight.HIGH.- Returns:
 - the weight of dimension features when considered as barriers to labeling
 - Since:
 - 100.14.0
 
 
- 
setBarrierWeight
public void setBarrierWeight(LabelBarrierWeight barrierWeight)
Sets the weight of dimension features when considered as barriers to labeling.The default is
LabelBarrierWeight.HIGH.- Parameters:
 barrierWeight- the weight of dimension features when considered as barriers to labeling- Throws:
 java.lang.IllegalArgumentException- if barrierWeight is null- Since:
 - 100.14.0
 
 
- 
getDefinitionExpression
public java.lang.String getDefinitionExpression()
Gets 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 The default value is an empty string, which will allow all dimension features in the data source to be used by the DimensionLayer.
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.
- Returns:
 - an expression which is a SQL statement where clause to specify the subset of features to be displayed
 - Since:
 - 100.13.0
 
 
- 
setDefinitionExpression
public void setDefinitionExpression(java.lang.String definitionExpression)
Sets 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 The default value is an empty string, which will allow all dimension features in the data source to be used by the DimensionLayer.
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.
- Parameters:
 definitionExpression- an expression which is a SQL statement where clause to specify the subset of features to be displayed- Throws:
 java.lang.IllegalArgumentException- if definitionExpression is null- Since:
 - 100.13.0
 
 
- 
getFeatureTable
public ArcGISFeatureTable getFeatureTable()
Gets the feature table associated with this layer.- Returns:
 - the feature table associated with this layer, or null if none
 - Since:
 - 100.13.0
 
 
- 
getLayerId
public long getLayerId()
Gets the layer ID that defines the layer within the feature service portal item.- Returns:
 - the layer ID that defines the layer within the feature service portal item
 - Since:
 - 100.13.0
 - See Also:
 Layer.getItem(),getLayerId()
 
- 
getReferenceScale
public double getReferenceScale()
Gets 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 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.
- Returns:
 - the reference scale for the layer
 - Since:
 - 100.13.0
 
 
- 
clearSelection
public void clearSelection()
Updates any selected features in the layer back to the un-selected state.- Since:
 - 100.13.0
 
 
- 
getSelectedFeaturesAsync
public ListenableFuture<FeatureQueryResult> getSelectedFeaturesAsync()
Returns a list of the currently selected features.- Returns:
 - a 
ListenableFuturethat returns aFeatureQueryResult - Since:
 - 100.13.0
 
 
- 
resetFeaturesVisible
public void resetFeaturesVisible()
Resets the visibility of the layer's features back to the original visibility when loaded from the data source.- Since:
 - 100.13.0
 
 
- 
selectFeature
public void selectFeature(Feature feature)
Selects the given feature and adds it to the current list of selected features.- Parameters:
 feature- the feature- Throws:
 java.lang.IllegalArgumentException- if feature is null- Since:
 - 100.13.0
 
 
- 
selectFeatures
public void selectFeatures(java.lang.Iterable<Feature> features)
Selects the features in the list and adds them to the current list of selected features.- Parameters:
 features- aIterableofFeature. Contents of theIterableare copied.- Throws:
 java.lang.IllegalArgumentException- if features is null- Since:
 - 100.13.0
 
 
- 
selectFeaturesAsync
public ListenableFuture<FeatureQueryResult> selectFeaturesAsync(QueryParameters parameters, FeatureLayer.SelectionMode mode)
Selects the features that match the criteria in theQueryParametersobject and adds them to the current list of selected features.- Parameters:
 parameters- the definition of the query to submit to the feature tablemode- defines how the list of currently selected features will be updated with the features returned from the query.- Returns:
 - a 
ListenableFuturethat returns aFeatureQueryResult - Throws:
 java.lang.IllegalArgumentException- if parameters is nulljava.lang.IllegalArgumentException- if mode is null- Since:
 - 100.13.0
 
 
- 
setFeatureVisible
public void setFeatureVisible(Feature feature, boolean visible)
Sets the visibility of the given feature.- Parameters:
 feature- the featurevisible- true to show, false to hide- Throws:
 java.lang.IllegalArgumentException- if feature is null- Since:
 - 100.13.0
 
 
- 
setFeaturesVisible
public void setFeaturesVisible(java.lang.Iterable<Feature> features, boolean visible)
Sets the visibility of the given features.- Parameters:
 features- aIterableofFeature. Contents of theIterableare copied.visible- true to show, false to hide- Throws:
 java.lang.IllegalArgumentException- if features is null- Since:
 - 100.13.0
 
 
- 
unselectFeature
public void unselectFeature(Feature feature)
Unselects the given feature and removes it from the current list of selected features.- Parameters:
 feature- the feature- Throws:
 java.lang.IllegalArgumentException- if feature is null- Since:
 - 100.13.0
 
 
- 
unselectFeatures
public void unselectFeatures(java.lang.Iterable<Feature> features)
Unselects the features in the given list and removes them from the current list of selected features.- Parameters:
 features- aIterableofFeature. Contents of theIterableare copied.- Throws:
 java.lang.IllegalArgumentException- if features is null- Since:
 - 100.13.0
 
 
- 
copy
public DimensionLayer copy()
Creates a deep copy of this DimensionLayer instance. This means that copies of all fields of this layer are made including its load state.- Returns:
 - a deep copy of this DimensionLayer instance
 - Since:
 - 100.13.0
 
 
- 
getCredential
public Credential getCredential()
Description copied from interface:RemoteResourceGets theCredentialthat is set on the network-enabled resource.Only applicable if the resource is secured.
- Specified by:
 getCredentialin interfaceRemoteResource- Returns:
 - the Credential, or null if there is none
 
 
- 
setCredential
public void setCredential(Credential credential)
Description copied from interface:RemoteResourceSets aCredentialto be used by the network-enabled resource in the event of an authentication challenge. The default credential is null.Only applicable if the resource is secured.
- Specified by:
 setCredentialin interfaceRemoteResource- Parameters:
 credential- the Credential to be used for authentication
 
- 
setRequestConfiguration
public void setRequestConfiguration(RequestConfiguration requestConfiguration)
Description copied from interface:RemoteResourceSets theRequestConfigurationused to modify the parameters of network requests made by thisRemoteResource. If not set, the globalRequestConfigurationwill be used (seeRequestConfiguration.getGlobalRequestConfiguration()).- Specified by:
 setRequestConfigurationin interfaceRemoteResource- Parameters:
 requestConfiguration- the RequestConfiguration used to modify network requests
 
- 
getRequestConfiguration
public RequestConfiguration getRequestConfiguration()
Description copied from interface:RemoteResourceGets theRequestConfigurationused to modify the parameters of network requests made by thisRemoteResource.- Specified by:
 getRequestConfigurationin interfaceRemoteResource- Returns:
 - the 
RequestConfigurationused to modify network requests 
 
 - 
 
 -