Package com.esri.arcgisruntime.layers
Class WmsSublayer
- java.lang.Object
-
- com.esri.arcgisruntime.layers.WmsSublayer
-
- All Implemented Interfaces:
LayerContent
public final class WmsSublayer extends java.lang.Object implements LayerContent
Represents a sublayer of a WmsLayer, providing data necessary for building a Table of Contents. Only named WMS sublayers have an associated WmsSublayer. A list of WmsSublayers can be obtained by callingWmsLayer.getSublayers()
on a loaded WmsLayer.- Since:
- 100.2.0
- See Also:
WmsLayer
-
-
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
getCurrentStyle()
Gets the name of the current style of this sublayer.java.lang.String
getName()
Gets the name of this layer.ListenableList<LayerContent>
getSubLayerContents()
Returns a list of sub layers, if any.WmsLayerInfo
getSublayerInfo()
Gets metadata for this sublayer.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)
Sets whether or not this layer should be visible in the legend.void
setCurrentStyle(java.lang.String styleName)
Sets the name of the style for this sublayer to use.void
setVisible(boolean visible)
Sets the layer's visibility ifLayerContent.canChangeVisibility()
returns true.
-
-
-
Method Detail
-
setCurrentStyle
public void setCurrentStyle(java.lang.String styleName)
Sets the name of the style for this sublayer to use.- Parameters:
styleName
- the name of the style to use, or an empty string to use the default style- Throws:
java.lang.IllegalArgumentException
- if styleName is null- Since:
- 100.3.0
-
getCurrentStyle
public java.lang.String getCurrentStyle()
Gets the name of the current style of this sublayer.- Returns:
- the name of the current style; an empty string indicates the default style is being used
- Since:
- 100.2.0
-
getSublayerInfo
public WmsLayerInfo getSublayerInfo()
Gets metadata for this sublayer.- Returns:
- the metadata
- Since:
- 100.2.0
-
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)
Description copied from interface:LayerContent
Sets whether or not this layer should be visible in the legend.- Specified by:
setCanShowInLegend
in interfaceLayerContent
- Parameters:
canShowInLegend
- true to show in the legend; false to omit it from the legend
-
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.
-
-