Class AnnotationSublayer
- java.lang.Object
-
- com.esri.arcgisruntime.layers.AnnotationSublayer
-
- All Implemented Interfaces:
LayerContent
public final class AnnotationSublayer extends java.lang.Object implements LayerContent
Allows you to interrogate the properties of a sublayer within an annotation layer and to change the visibility of the sublayer.You can get a list of
AnnotationSublayer
fromAnnotationLayer
usingLayerContent.getSubLayerContents()
.AnnotationSublayer
objects only exist as part of anAnnotationLayer
object, populated when theAnnotationLayer
is loaded. They cannot exist separately. Annotation sublayers offer finer control over your annotation, allowing the author to set different visual properties from the parent annotation layer. These visual properties include font, size, color, or different minimum and maximum scale ranges.- Since:
- 100.6.0
- See Also:
AnnotationLayer
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canChangeVisibility()
Checks whether we can change the visibility of this layer.boolean
canShowInLegend()
Checks if this layer will be listed in the legend.ListenableFuture<java.util.List<LegendInfo>>
fetchLegendInfosAsync()
Asynchronously fetches a list of legend information for this layer, if any.java.lang.String
getDefinitionExpression()
Gets the where-clause of the SQL expression that defines which annotation features from the feature table are selected into this sublayer.double
getMaxScale()
Gets the maximum scale at which to display the sublayer.double
getMinScale()
Gets the minimum scale at which to display the sublayer.java.lang.String
getName()
Gets the name of this layer.float
getOpacity()
Gets the opacity with which to display the annotation text associated with this sublayer.ListenableList<LayerContent>
getSubLayerContents()
Returns a list of sub layers, if any.long
getSublayerId()
Gets the ID number of this sublayer within its AnnotationLayer.boolean
isScaleSymbols()
This is always true, indicating that the annotation text always scales with the MapView.boolean
isVisible()
Checks if this layer is visible or not.boolean
isVisibleAtScale(double scale)
Checks if this layer has effective visibility at the given scale.void
setCanShowInLegend(boolean canShowInLegend)
Setting this property is not supported on AnnotationSublayer.void
setVisible(boolean visible)
Sets the layer's visibility ifLayerContent.canChangeVisibility()
returns true.
-
-
-
Method Detail
-
getDefinitionExpression
public java.lang.String getDefinitionExpression()
Gets the where-clause of the SQL expression that defines which annotation features from the feature table are selected into this sublayer.The definition expression string uses the SQL-92 where clause syntax (https://en.wikipedia.org/wiki/SQL-92). 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" ( https://www.esri.com/arcgis-blog/products/api-rest/data-management/querying-feature-services-date-time-queries/) for more information.
- Returns:
- the definition expression
- Since:
- 100.6.0
-
getMaxScale
public double getMaxScale()
Gets the maximum scale at which to display the sublayer.- Returns:
- the maximum scale at which to display the sublayer
- Since:
- 100.6.0
-
getMinScale
public double getMinScale()
Gets the minimum scale at which to display the sublayer. Zero indicates that the annotation will be visible no matter how far the user zooms out.- Returns:
- the minimum scale at which to display the sublayer
- Since:
- 100.6.0
-
getOpacity
public float getOpacity()
Gets the opacity with which to display the annotation text associated with this sublayer.Opacity is a value between 0.0 and 1.0, with 0.0 indicating that the annotation will be completely transparent, and 1.0 indicating that the annotation will be completely opaque.
- Returns:
- the opacity with which to display the annotation text
- Since:
- 100.6.0
-
getSublayerId
public long getSublayerId()
Gets the ID number of this sublayer within its AnnotationLayer.- Returns:
- the sublayer ID, a non-negative integer
- Since:
- 100.6.0
- See Also:
AnnotationLayer
-
isScaleSymbols
public boolean isScaleSymbols()
This is always true, indicating that the annotation text always scales with the MapView.- Returns:
- always true
- Since:
- 100.6.0
- See Also:
MapView
-
canChangeVisibility
public boolean canChangeVisibility()
Description copied from interface:LayerContent
Checks whether we can change the visibility of this layer.- Specified by:
canChangeVisibility
in interfaceLayerContent
- Returns:
- true if we can change this layer's visibility; false otherwise
-
isVisible
public boolean isVisible()
Description copied from interface:LayerContent
Checks if this layer is visible or not.- Specified by:
isVisible
in interfaceLayerContent
- Returns:
- true if the layer is visible; false otherwise
- See Also:
LayerContent.setVisible(boolean)
-
setVisible
public void setVisible(boolean visible)
Description copied from interface:LayerContent
Sets the layer's visibility ifLayerContent.canChangeVisibility()
returns true.- Specified by:
setVisible
in interfaceLayerContent
- Parameters:
visible
- true to make the layer visible; false to hide it- See Also:
LayerContent.isVisible()
-
isVisibleAtScale
public boolean isVisibleAtScale(double scale)
Description copied from interface:LayerContent
Checks if this layer has effective visibility at the given scale. This effective visibility takes care of the effective visibility of the parents at the specified scale.- Specified by:
isVisibleAtScale
in interfaceLayerContent
- Parameters:
scale
- the scale the visibility has to be calculated for- Returns:
- true if the layer will be visible at the given scale; false otherwise
-
getName
public java.lang.String getName()
Description copied from interface:LayerContent
Gets the name of this layer.- Specified by:
getName
in interfaceLayerContent
- Returns:
- name of this layer
-
canShowInLegend
public boolean canShowInLegend()
Description copied from interface:LayerContent
Checks if this layer will be listed in the legend.- Specified by:
canShowInLegend
in interfaceLayerContent
- Returns:
- true if this layer will be visible in the legend; false otherwise
-
setCanShowInLegend
public void setCanShowInLegend(boolean canShowInLegend)
Setting this property is not supported on AnnotationSublayer.- Specified by:
setCanShowInLegend
in interfaceLayerContent
- Parameters:
canShowInLegend
- true to show in the legend, false to omit it from the legend- Throws:
java.lang.UnsupportedOperationException
- always throws this exception- Since:
- 100.6.0
-
getSubLayerContents
public ListenableList<LayerContent> getSubLayerContents()
Description copied from interface:LayerContent
Returns a list of sub layers, if any. If there are no sub-layers, an empty list will be returned. This list cannot be used to add or remove sub-layers.- Specified by:
getSubLayerContents
in interfaceLayerContent
- Returns:
- a read only list of sub-layers, if any
-
fetchLegendInfosAsync
public ListenableFuture<java.util.List<LegendInfo>> fetchLegendInfosAsync()
Description copied from interface:LayerContent
Asynchronously fetches a list of legend information for this layer, if any.- Specified by:
fetchLegendInfosAsync
in interfaceLayerContent
- Returns:
- a listenable future that can be used to get the legend information. Null is returned if an error occurs.
-
-