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
AnnotationSublayerfromAnnotationLayerusingLayerContent.getSubLayerContents().AnnotationSublayerobjects only exist as part of anAnnotationLayerobject, populated when theAnnotationLayeris 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 booleancanChangeVisibility()Checks whether we can change the visibility of this layer.booleancanShowInLegend()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.StringgetDefinitionExpression()Gets the where-clause of the SQL expression that defines which annotation features from the feature table are selected into this sublayer.doublegetMaxScale()Gets the maximum scale at which to display the sublayer.doublegetMinScale()Gets the minimum scale at which to display the sublayer.java.lang.StringgetName()Gets the name of this layer.floatgetOpacity()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.longgetSublayerId()Gets the ID number of this sublayer within its AnnotationLayer.booleanisScaleSymbols()This is always true, indicating that the annotation text always scales with the MapView.booleanisVisible()Checks if this layer is visible or not.booleanisVisibleAtScale(double scale)Checks if this layer has effective visibility at the given scale.voidsetCanShowInLegend(boolean canShowInLegend)Setting this property is not supported on AnnotationSublayer.voidsetVisible(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:LayerContentChecks whether we can change the visibility of this layer.- Specified by:
canChangeVisibilityin interfaceLayerContent- Returns:
- true if we can change this layer's visibility; false otherwise
-
isVisible
public boolean isVisible()
Description copied from interface:LayerContentChecks if this layer is visible or not.- Specified by:
isVisiblein 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:LayerContentSets the layer's visibility ifLayerContent.canChangeVisibility()returns true.- Specified by:
setVisiblein 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:LayerContentChecks 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:
isVisibleAtScalein 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:LayerContentGets the name of this layer.- Specified by:
getNamein interfaceLayerContent- Returns:
- name of this layer
-
canShowInLegend
public boolean canShowInLegend()
Description copied from interface:LayerContentChecks if this layer will be listed in the legend.- Specified by:
canShowInLegendin 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:
setCanShowInLegendin 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:LayerContentReturns 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:
getSubLayerContentsin interfaceLayerContent- Returns:
- a read only list of sub-layers, if any
-
fetchLegendInfosAsync
public ListenableFuture<java.util.List<LegendInfo>> fetchLegendInfosAsync()
Description copied from interface:LayerContentAsynchronously fetches a list of legend information for this layer, if any.- Specified by:
fetchLegendInfosAsyncin interfaceLayerContent- Returns:
- a listenable future that can be used to get the legend information. Null is returned if an error occurs.
-
-