- All Implemented Interfaces:
LayerContent
You can change the sublayer's visibility and interrogate its read-only properties, such as the maximum and minimum scale, opacity, and definition expression.
Use the LayerContent.getSubLayerContents()
to get a read-only collection of sublayers from the
AnnotationLayer
. Each AnnotationSublayer object only exists as part of an AnnotationLayer
object and
is populated when the AnnotationLayer
is loaded.
- Since:
- 100.6.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Checks whether we can change the visibility of this layer.boolean
Checks if this layer will be listed in the legend.Asynchronously fetches a list of legend information for this layer, if any.Gets the where-clause of the SQL expression that defines which annotation features from the feature table are selected into this sublayer.double
Gets the maximum scale at which to display the sublayer.double
Gets the minimum scale at which to display the sublayer.getName()
Gets the name of this layer.float
Gets the opacity of the annotation text associated with this sublayer.Returns a list of sub layers, if any.long
Gets the ID number of this sublayer within its AnnotationLayer.boolean
True if the annotation text scales with theMapView
.boolean
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 Details
-
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. For more information, see the ArcGIS Blog article Querying Feature Services Date-Time Queries.
- 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 of 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:
-
isScaleSymbols
public boolean isScaleSymbols()True if the annotation text scales with theMapView
.The returned value is always true.
- Returns:
- always true
- Since:
- 100.6.0
- See Also:
-
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:
-
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:
-
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
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:
UnsupportedOperationException
- always throws this exception- Since:
- 100.6.0
-
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
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.
-