Class AnnotationSublayer

java.lang.Object
com.esri.arcgisruntime.layers.AnnotationSublayer
All Implemented Interfaces:
LayerContent

public final class AnnotationSublayer extends Object implements LayerContent
A sublayer of the annotation layer.

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 Details

    • getDefinitionExpression

      public 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. 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 the MapView.

      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 interface LayerContent
      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 interface LayerContent
      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 if LayerContent.canChangeVisibility() returns true.
      Specified by:
      setVisible in interface LayerContent
      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 interface LayerContent
      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 String getName()
      Description copied from interface: LayerContent
      Gets the name of this layer.
      Specified by:
      getName in interface LayerContent
      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 interface LayerContent
      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 interface LayerContent
      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

      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 interface LayerContent
      Returns:
      a read only list of sub-layers, if any
    • fetchLegendInfosAsync

      public ListenableFuture<List<LegendInfo>> fetchLegendInfosAsync()
      Description copied from interface: LayerContent
      Asynchronously fetches a list of legend information for this layer, if any.
      Specified by:
      fetchLegendInfosAsync in interface LayerContent
      Returns:
      a listenable future that can be used to get the legend information. Null is returned if an error occurs.