Interface LayerContent

All Known Implementing Classes:
AnnotationLayer, AnnotationSublayer, ArcGISMapImageLayer, ArcGISMapImageSublayer, ArcGISSceneLayer, ArcGISSublayer, ArcGISTiledLayer, ArcGISTiledSublayer, ArcGISVectorTiledLayer, BingMapsLayer, DimensionLayer, DynamicEntityLayer, EncLayer, FeatureCollectionLayer, FeatureLayer, GroupLayer, ImageAdjustmentLayer, ImageTiledLayer, IntegratedMeshLayer, KmlLayer, Layer, MobileBasemapLayer, OpenStreetMapLayer, PointCloudLayer, RasterLayer, ServiceImageTiledLayer, SubtypeFeatureLayer, SubtypeSublayer, UnknownLayer, UnsupportedLayer, WebTiledLayer, WmsLayer, WmsSublayer, WmtsLayer

public interface LayerContent
A layer implements this interface to provide information about the layer visibility, the layer legend, and the sub layers hierarchy. This information can be used to generate a Table of Contents or legend without knowledge of the actual layer type.

Implemented by Layer and ArcGISSublayer.

Since:
100.0.0
  • Method Details

    • canChangeVisibility

      boolean canChangeVisibility()
      Checks whether we can change the visibility of this layer.
      Returns:
      true if we can change this layer's visibility; false otherwise
      Since:
      100.0.0
    • isVisible

      boolean isVisible()
      Checks if this layer is visible or not.
      Returns:
      true if the layer is visible; false otherwise
      Since:
      100.0.0
      See Also:
    • setVisible

      void setVisible(boolean isVisible)
      Sets the layer's visibility if canChangeVisibility() returns true.
      Parameters:
      isVisible - true to make the layer visible; false to hide it
      Since:
      100.0.0
      See Also:
    • canShowInLegend

      boolean canShowInLegend()
      Checks if this layer will be listed in the legend.
      Returns:
      true if this layer will be visible in the legend; false otherwise
      Since:
      100.0.0
    • setCanShowInLegend

      void setCanShowInLegend(boolean canShowInLegend)
      Sets whether or not this layer should be visible in the legend.
      Parameters:
      canShowInLegend - true to show in the legend; false to omit it from the legend
      Since:
      100.0.0
    • getName

      String getName()
      Gets the name of this layer.
      Returns:
      name of this layer
      Since:
      100.0.0
    • getSubLayerContents

      ListenableList<LayerContent> getSubLayerContents()
      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.
      Returns:
      a read only list of sub-layers, if any
      Since:
      100.0.0
    • fetchLegendInfosAsync

      ListenableFuture<List<LegendInfo>> fetchLegendInfosAsync()
      Asynchronously fetches a list of legend information for this layer, if any.
      Returns:
      a listenable future that can be used to get the legend information. Null is returned if an error occurs.
      Since:
      100.0.0
    • isVisibleAtScale

      boolean isVisibleAtScale(double scale)
      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.
      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
      Since:
      100.0.0