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
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.
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(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 void
clearSelection()
Updates any selected features in the layer back to the un-selected state.DimensionLayer
copy()
Creates a deep copy of this DimensionLayer instance.LabelBarrierWeight
getBarrierWeight()
Gets the weight of dimension features when considered as barriers to labeling.Credential
getCredential()
Gets theCredential
that is set on the network-enabled resource.String
getDefinitionExpression()
Gets an expression which is a SQL statement where clause to specify the subset of features to be displayed.ArcGISFeatureTable
getFeatureTable()
Gets the feature table associated with this layer.long
getLayerId()
Gets the layer ID that defines the layer within the feature service portal item.double
getReferenceScale()
Gets the reference scale for the layer.RequestConfiguration
getRequestConfiguration()
Gets theRequestConfiguration
used to modify the parameters of network requests made by thisRemoteResource
.ListenableFuture<FeatureQueryResult>
getSelectedFeaturesAsync()
Returns a list of the currently selected features.String
getUri()
Gets the URI of a feature service to define the layer.void
resetFeaturesVisible()
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.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.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 an expression which is a SQL statement where clause to specify the 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, 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:
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 servicePortalItem
layerId
- the layer ID for which to create the layer- Throws:
IllegalArgumentException
- if item is null- Since:
- 100.13.0
- See Also:
Layer.getItem()
-
DimensionLayer
public DimensionLayer(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:
IllegalArgumentException
- if uri is null or empty- Since:
- 100.13.0
-
-
Method Detail
-
getUri
public String 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
- 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:
IllegalArgumentException
- if barrierWeight is null- Since:
- 100.14.0
-
getDefinitionExpression
public 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(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:
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
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
public void selectFeature(Feature feature)
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
public void selectFeatures(Iterable<Feature> features)
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
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:
IllegalArgumentException
- if feature is null- Since:
- 100.13.0
-
setFeaturesVisible
public void setFeaturesVisible(Iterable<Feature> features, boolean visible)
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
public void unselectFeature(Feature feature)
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
public void unselectFeatures(Iterable<Feature> features)
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
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: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
public void setCredential(Credential credential)
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
public void setRequestConfiguration(RequestConfiguration requestConfiguration)
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
public RequestConfiguration 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
-
-