- All Implemented Interfaces:
RemoteResource
,LayerContent
,Loadable
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
ServiceFeatureTable
that has a feature layer service type ofArcGISFeatureLayerInfo.ServiceType.DIMENSION_LAYER
-
An offline
GeodatabaseFeatureTable
returned by theGeodatabase.getGeodatabaseDimensionTables()
collection when aGenerateGeodatabaseJob
has 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.
You cannot add, change, or delete a dimension feature. Any attempt produces a "Geodatabase table not editable" (3016) error.
The getFeatureTable()
associated with this DimensionLayer contains a set of attributes (fields,
in other words) that define "dimensions".
These attributes, automatically added by ArcGIS Pro, are described in
"Dimension fields".
The author of the dimension layer may have also added additional fields. You can query and use any of these
attributes in a definition expression but you cannot change their value.
You do not have access to, and cannot change, the renderer or the styles used for rendering dimensions.
- Since:
- 100.13.0
-
Property Summary
Properties inherited from class com.esri.arcgisruntime.layers.Layer
loadError, loadStatus
-
Constructor Summary
ConstructorDescriptionDimensionLayer
(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
(String uri) Creates a new dimension layer from a feature service URI. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Updates any selected features in the layer back to the un-selected state.copy()
Creates a deep copy of this DimensionLayer instance.Gets the weight of dimension features when considered as barriers to labeling.Gets theCredential
that is set on the network-enabled resource.Gets a SQL statement where clause that stipulates a subset of features to be displayed.Gets the feature table associated with this layer.long
Gets the layer ID that defines the layer within the feature service portal item.double
Gets the reference scale for the layer.Gets theRequestConfiguration
used to modify the parameters of network requests made by thisRemoteResource
.Returns a list of the currently selected features.getUri()
Gets the URI of a feature service to define the layer.void
Resets the visibility of the layer's features back to the original visibility when loaded from the data source.void
selectFeature
(Feature feature) Selects the given feature and adds it to the current list of selected features.void
selectFeatures
(Iterable<Feature> features) Selects the features in the list and adds them to the current list of selected features.selectFeaturesAsync
(QueryParameters parameters, FeatureLayer.SelectionMode mode) Selects the features that match the criteria in theQueryParameters
object and adds them to the current list of selected features.void
setBarrierWeight
(LabelBarrierWeight barrierWeight) Sets the weight of dimension features when considered as barriers to labeling.void
setCredential
(Credential credential) Sets aCredential
to be used by the network-enabled resource in the event of an authentication challenge.void
setDefinitionExpression
(String definitionExpression) Sets a SQL statement where clause that stipulates a subset of features to be displayed.void
setFeaturesVisible
(Iterable<Feature> features, boolean visible) Sets the visibility of the given features.void
setFeatureVisible
(Feature feature, boolean visible) Sets the visibility of the given feature.void
setRequestConfiguration
(RequestConfiguration requestConfiguration) Sets theRequestConfiguration
used to modify the parameters of network requests made by thisRemoteResource
.void
unselectFeature
(Feature feature) Unselects the given feature and removes it from the current list of selected features.void
unselectFeatures
(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, loadErrorProperty, loadStatusProperty, removeDoneLoadingListener, removeLoadStatusChangedListener, removeVisibilityChangedListener, retryLoadAsync, setCanShowInLegend, setDescription, setId, setMaxScale, setMinScale, setName, setOpacity, setVisible
-
Constructor Details
-
DimensionLayer
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:
IllegalArgumentException
- if featureTable is null- Since:
- 100.13.0
-
DimensionLayer
Creates a new dimension layer object from a feature service portal item.- Parameters:
item
- a feature servicePortalItem
layerId
- the layer ID for which to create the layer- Throws:
IllegalArgumentException
- if item is null- Since:
- 100.13.0
- See Also:
-
DimensionLayer
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:
IllegalArgumentException
- if uri is null or empty- Since:
- 100.13.0
-
-
Method Details
-
getUri
Gets the URI of a feature service to define the layer.- Specified by:
getUri
in interfaceRemoteResource
- Returns:
- the URI of a feature service to define the layer, or null if none
- Since:
- 100.13.0
-
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
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:
IllegalArgumentException
- if barrierWeight is null- Since:
- 100.14.0
-
getDefinitionExpression
Gets a SQL statement where clause that stipulates a 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. For more information, see the ArcGIS Blog article Querying Feature Services Date-Time Queries.
- Returns:
- an expression which is a SQL statement where clause to specify the subset of features to be displayed
- Since:
- 100.13.0
-
setDefinitionExpression
Sets a SQL statement where clause that stipulates a 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:
IllegalArgumentException
- if definitionExpression is null- Since:
- 100.13.0
-
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:
-
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
Returns a list of the currently selected features.- Returns:
- a
ListenableFuture
that 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
Selects the given feature and adds it to the current list of selected features.- Parameters:
feature
- the feature- Throws:
IllegalArgumentException
- if feature is null- Since:
- 100.13.0
-
selectFeatures
Selects the features in the list and adds them to the current list of selected features.- Parameters:
features
- aIterable
ofFeature
. Contents of theIterable
are copied.- Throws:
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 theQueryParameters
object 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
ListenableFuture
that returns aFeatureQueryResult
- Throws:
IllegalArgumentException
- if parameters is nullIllegalArgumentException
- if mode is null- Since:
- 100.13.0
-
setFeatureVisible
Sets the visibility of the given feature.- Parameters:
feature
- the featurevisible
- true to show, false to hide- Throws:
IllegalArgumentException
- if feature is null- Since:
- 100.13.0
-
setFeaturesVisible
Sets the visibility of the given features.- Parameters:
features
- aIterable
ofFeature
. Contents of theIterable
are copied.visible
- true to show, false to hide- Throws:
IllegalArgumentException
- if features is null- Since:
- 100.13.0
-
unselectFeature
Unselects the given feature and removes it from the current list of selected features.- Parameters:
feature
- the feature- Throws:
IllegalArgumentException
- if feature is null- Since:
- 100.13.0
-
unselectFeatures
Unselects the features in the given list and removes them from the current list of selected features.- Parameters:
features
- aIterable
ofFeature
. Contents of theIterable
are copied.- Throws:
IllegalArgumentException
- if features is null- Since:
- 100.13.0
-
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
Description copied from interface:RemoteResource
Gets theCredential
that is set on the network-enabled resource.Only applicable if the resource is secured.
- Specified by:
getCredential
in interfaceRemoteResource
- Returns:
- the Credential, or null if there is none
-
setCredential
Description copied from interface:RemoteResource
Sets aCredential
to 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:
setCredential
in interfaceRemoteResource
- Parameters:
credential
- the Credential to be used for authentication
-
setRequestConfiguration
Description copied from interface:RemoteResource
Sets theRequestConfiguration
used to modify the parameters of network requests made by thisRemoteResource
. If not set, the globalRequestConfiguration
will be used (seeRequestConfiguration.getGlobalRequestConfiguration()
).- Specified by:
setRequestConfiguration
in interfaceRemoteResource
- Parameters:
requestConfiguration
- the RequestConfiguration used to modify network requests
-
getRequestConfiguration
Description copied from interface:RemoteResource
Gets theRequestConfiguration
used to modify the parameters of network requests made by thisRemoteResource
.- Specified by:
getRequestConfiguration
in interfaceRemoteResource
- Returns:
- the
RequestConfiguration
used to modify network requests
-