- All Implemented Interfaces:
 RemoteResource,LayerContent,Loadable,PopupSource
- Direct Known Subclasses:
 ArcGISMapImageSublayer,ArcGISTiledSublayer,SubtypeSublayer
ArcGISMapImageSublayer, ArcGISTiledSublayer and
 SubtypeSublayer.
 
 Some layers, such as ArcGISMapImageLayer, ArcGISTiledLayer, and SubtypeFeatureLayer, represent
 a collection of layers that are referred to as sublayers. For example, ArcGISMapImageLayer represents the
 collection of ArcGISMapImageLayer.getSublayers().
 
 If one of the sublayers is a group layer (where the ArcGISMapServiceSublayerInfo.getServiceType() is
 ArcGISMapServiceSublayerInfo.ServiceType.GROUP_LAYER, for example), it will also have a collection of sublayers. Use
 getSublayers() to obtain the collection of sublayers. If one of these sublayers is a group
 layer it will also contain a collection of sublayers, and so on.
 
Note: Some of the sublayer properties can only be accessed once the sublayer has loaded.
- Since:
 - 100.0.0
 - See Also:
 
- 
Property Summary
PropertiesTypePropertyDescriptionThe load error.The load status. - 
Method Summary
Modifier and TypeMethodDescriptionvoidaddDoneLoadingListener(Runnable listener) Adds a listener to the loadable resource that is invoked when loading has completed.voidAdds aLoadStatusChangedListenerto the loadable resource that is invoked whenever the load status changes.voidCancels loading metadata for the object.booleanChecks whether we can change the visibility of this layer.booleanTrue if the sublayer renderers its symbols based on scale, false otherwise.booleanChecks if this layer will be listed in the legend.abstract ArcGISSublayercopy()Creates a deep copy of this ArcGISSublayer instance.protected voidcopyTo(ArcGISSublayer copy) Copies fields in this class to the copy instance.Gets properties from the legend information of this sublayer.Gets the credential used to authenticate the user with the sublayer.A SQL statement where clause that stipulates a subset of features to be displayed.longgetId()Gets the ID that uniquely identifies this sublayer.Returns the most recent error that was encountered when the loadable resource transitioned to theLoadStatus.FAILED_TO_LOADstate, either due to calling theLoadable.loadAsync()orLoadable.retryLoadAsync()method.Returns theLoadStatusof the loadable resource.Gets the metadata for this sublayer.doubleGets the maximum viewing level at which this sublayer can be visible on a map.doubleGets the minimum viewing level at which this sublayer can be visible on a map.getName()Gets the name property of this sublayer.floatGets the opacity of this sublayer.Gets the PopupDefinition defined in the ArcGISSublayer definition or set viasetPopupDefinition(PopupDefinition), or null if one is not defined and one has not been set.Gets the renderer for this sublayer.Gets the RequestConfiguration in use by this sublayer.Returns a list of sub layers, if any.Gets the collection of sublayers of a sublayer.getUri()Gets the URL for this sublayer.booleanTrue if the sublayer's labels are enabled, false otherwise.booleanChecks if the pop-up definition returned fromPopupSource.getPopupDefinition()is enabled or disabled.booleanIndicates if the sublayer is visible on the map.booleanisVisibleAtScale(double scale) Checks if this layer has effective visibility at the given scale.voidLoads the metadata of the loadable resource asynchronously.The load error.The load status.booleanremoveDoneLoadingListener(Runnable listener) Removes a done loading listener from the loadable resource.booleanRemoves aLoadStatusChangedListenerfrom the loadable resource.voidLoads or retries loading metadata for the object asynchronously.voidsetCanShowInLegend(boolean canShowInLegend) Sets whether or not this layer should be visible in the legend.voidsetCredential(Credential credential) Sets the credential used to authenticate the user with the sublayer.voidsetPopupDefinition(PopupDefinition popupDefinition) Sets the PopupDefinition for the ArcGISSublayer, overriding the previous one (for example, the one defined in the ArcGISSublayer definition).voidsetPopupEnabled(boolean enabled) Sets whether the pop-up definition returned fromPopupSource.getPopupDefinition()is enabled or disabled.protected voidsetRenderer(Renderer renderer) Allows sub-classes to set the renderer reference e.g.voidsetRequestConfiguration(RequestConfiguration requestConfiguration) Sets the configuration parameters used for sending a network request using this sublayer object.voidsetVisible(boolean isVisible) Shows or hides this sublayer from a map. 
- 
Property Details
- 
loadStatus
- Specified by:
 loadStatusPropertyin interfaceLoadable- See Also:
 
 - 
loadError
- Specified by:
 loadErrorPropertyin interfaceLoadable- See Also:
 
 
 - 
 - 
Method Details
- 
getId
public long getId()Gets the ID that uniquely identifies this sublayer.- Returns:
 - the ID of this sublayer
 - Since:
 - 100.0.0
 
 - 
getSublayers
Gets the collection of sublayers of a sublayer.This collection is usually empty unless the parent layer is loaded. Modifying this collection has no effect unless this sublayer is associated with an ArcGIS map service that supports dynamic layers. "Supports Dynamic Layers" must be set to true in the ArcGIS MapServer REST Services Directory.
- Returns:
 - the collection of sublayers of a sublayer
 - Since:
 - 100.0.0
 
 - 
getMinScale
public double getMinScale()Gets the minimum viewing level at which this sublayer can be visible on a map.- Returns:
 - the minimum scale that this sublayer will be visible
 - Since:
 - 100.0.0
 
 - 
getMaxScale
public double getMaxScale()Gets the maximum viewing level at which this sublayer can be visible on a map.- Returns:
 - the maximum scale that this sublayer will be visible
 - Since:
 - 100.0.0
 
 - 
getDefinitionExpression
A SQL statement where clause that stipulates a subset of features to be displayed.The definition expression string uses the SQL-92 where clause syntax. 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.1.0
 
 - 
getMapServiceSublayerInfo
Gets the metadata for this sublayer.- Returns:
 - the metadata, or null if this sublayer is not loaded
 - Since:
 - 100.1.0
 
 - 
getOpacity
public float getOpacity()Gets the opacity of this sublayer.- Returns:
 - the opacity
 - Since:
 - 100.1.0
 
 - 
getRenderer
Gets the renderer for this sublayer.- Returns:
 - the renderer, or null if the sublayer is not loaded
 - Since:
 - 100.1.0
 
 - 
setRenderer
Allows sub-classes to set the renderer reference e.g.ArcGISMapImageSublayerallows a renderer to be set.- Parameters:
 renderer- the renderer to set- Since:
 - 100.1.0
 
 - 
canScaleSymbols
public boolean canScaleSymbols()True if the sublayer renderers its symbols based on scale, false otherwise.- Returns:
 - true if the text and symbols will change as the map scale varies, false otherwise
 - Since:
 - 100.1.0
 
 - 
isLabelsEnabled
public boolean isLabelsEnabled()True if the sublayer's labels are enabled, false otherwise.- Returns:
 - true if labels are enabled, false otherwise
 - Since:
 - 100.1.0
 
 - 
getName
Gets the name property of this sublayer.- Specified by:
 getNamein interfaceLayerContent- Returns:
 - the name of this sublayer
 - Since:
 - 100.0.0
 
 - 
getPopupDefinition
Gets the PopupDefinition defined in the ArcGISSublayer definition or set viasetPopupDefinition(PopupDefinition), or null if one is not defined and one has not been set.- Specified by:
 getPopupDefinitionin interfacePopupSource- Returns:
 - the ArcGISSublayer's PopupDefinition
 - Since:
 - 100.0.0
 - See Also:
 
 - 
setPopupDefinition
Sets the PopupDefinition for the ArcGISSublayer, overriding the previous one (for example, the one defined in the ArcGISSublayer definition).- Specified by:
 setPopupDefinitionin interfacePopupSource- Parameters:
 popupDefinition- the PopupDefinition to set- Since:
 - 100.0.0
 - See Also:
 
 - 
isPopupEnabled
public boolean isPopupEnabled()Description copied from interface:PopupSourceChecks if the pop-up definition returned fromPopupSource.getPopupDefinition()is enabled or disabled.- Specified by:
 isPopupEnabledin interfacePopupSource- Returns:
 - true if the pop-up definition is enabled; false otherwise. Will return false if an error occurs.
 - See Also:
 
 - 
setPopupEnabled
public void setPopupEnabled(boolean enabled) Description copied from interface:PopupSourceSets whether the pop-up definition returned fromPopupSource.getPopupDefinition()is enabled or disabled.- Specified by:
 setPopupEnabledin interfacePopupSource- Parameters:
 enabled- true to enable the PopupDefinition; false otherwise- See Also:
 
 - 
isVisible
public boolean isVisible()Indicates if the sublayer is visible on the map.The visibility of a sublayer can change if it is manually set,
setVisible(boolean), or the map's scale is outside of the sublayer's scale.- Specified by:
 isVisiblein interfaceLayerContent- Returns:
 - true if sublayer is visible; false otherwise
 - Since:
 - 100.0.0
 - See Also:
 
 - 
setVisible
public void setVisible(boolean isVisible) Shows or hides this sublayer from a map.The default value for a sublayer's visibility is set to true.
- Specified by:
 setVisiblein interfaceLayerContent- Parameters:
 isVisible- true makes the sublayer visible, false makes it invisible- Since:
 - 100.0.0
 - See Also:
 
 - 
fetchLegendInfosAsync
Gets properties from the legend information of this sublayer.These properties allow access to a Feature's name and symbol.
- Specified by:
 fetchLegendInfosAsyncin interfaceLayerContent- Returns:
 - a listenable future that supplies a list of legend information.
 - Since:
 - 100.0.0
 - See Also:
 
 - 
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) Description copied from interface:LayerContentSets whether or not this layer should be visible in the legend.- Specified by:
 setCanShowInLegendin interfaceLayerContent- Parameters:
 canShowInLegend- true to show in the legend; false to omit it from the legend
 - 
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
 
 - 
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
 
 - 
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
 
 - 
getLoadStatus
Description copied from interface:LoadableReturns theLoadStatusof the loadable resource.- Specified by:
 getLoadStatusin interfaceLoadable- Returns:
 - the LoadStatus of the loadable resource
 - Since:
 - 100.1.0
 
 - 
getLoadError
Description copied from interface:LoadableReturns the most recent error that was encountered when the loadable resource transitioned to theLoadStatus.FAILED_TO_LOADstate, either due to calling theLoadable.loadAsync()orLoadable.retryLoadAsync()method.If the resource subsequently transitions to
LoadStatus.LOADED(for example, if a call toretryLoadAsynccompletes successfully) the error is cleared out.- Specified by:
 getLoadErrorin interfaceLoadable- Returns:
 - the most recent error that was encountered when the loadable resource transitioned to the
         
LoadStatus.FAILED_TO_LOADstate. - Since:
 - 100.1.0
 
 - 
loadAsync
public void loadAsync()Description copied from interface:LoadableLoads the metadata of the loadable resource asynchronously.The load status changes from
LoadStatus.NOT_LOADEDtoLoadStatus.LOADING. A listener can be added viaLoadable.addDoneLoadingListener(java.lang.Runnable)that is invoked upon completion of the asynchronous load operation.If the load operation completes successfully, the load status will be
LoadStatus.LOADED, which means the resource has loaded its metadata.If the load operation failed, the load status will be
LoadStatus.FAILED_TO_LOADand the error can be retrieved by callingLoadable.getLoadError().This method can be called concurrently and repeatedly, but only one attempt is ever made to perform the load operation. If a load operation is already in progress (
LoadStatus.LOADINGstate) whenloadAsyncis called, it simply piggy-backs on the outstanding operation and the done loading listener added to the loadable resource is enqueued to be invoked when that operation completes. If the operation has already completed (LoadStatus.LOADEDorLoadStatus.FAILED_TO_LOADstate) whenloadAsyncis called, the done loading listener is immediately invoked when added to the loadable resource.If a loadable resource has failed to load, calling
loadAsyncon it subsequently will not change its state. The done loading listener will be invoked immediately when added to the loadable resource. In order to retry loading the resource,Loadable.retryLoadAsync()needs to be used.A load operation that is in progress (
LoadStatus.LOADINGstate) can be cancelled by callingLoadable.cancelLoad(). - 
retryLoadAsync
public void retryLoadAsync()Description copied from interface:LoadableLoads or retries loading metadata for the object asynchronously.Will retry loading the metadata if the object's load status is
LoadStatus.FAILED_TO_LOAD. Will load the object if it is not loaded. Will not retry to load the object if the object is loaded.For more details on the load process see
Loadable.loadAsync().- Specified by:
 retryLoadAsyncin interfaceLoadable- Since:
 - 100.1.0
 
 - 
cancelLoad
public void cancelLoad()Description copied from interface:LoadableCancels loading metadata for the object.Cancels loading the metadata if the object is loading, and always invokes the done loading listener.
A load operation that is in progress (
LoadStatus.LOADINGstate) can be cancelled by calling this method and the resource will transition fromLoadStatus.LOADINGtoLoadStatus.FAILED_TO_LOADstate. If the load operation was successfully cancelled, a CancellationException will be returned fromLoadable.getLoadError().Cancellation should be used carefully because all enqueued done loading listeners for that resource instance will get invoked with an error stating that the operation was cancelled. Thus, one component in the application can cancel the load operation initiated by other components.
This method does nothing if the resource is not in
LoadStatus.LOADINGstate.- Specified by:
 cancelLoadin interfaceLoadable- Since:
 - 100.1.0
 
 - 
addDoneLoadingListener
Description copied from interface:LoadableAdds a listener to the loadable resource that is invoked when loading has completed.The listener may be added at any point, whether the loadable resource has already completed loading or not.
- For resources that are not loaded when the listener is added (LoadStatus is NOT_LOADED or LOADING): When the resource completes loading, the listener will be invoked on the UI thread if it is added from the UI thread, otherwise it is not guaranteed on which thread the listener is invoked.
 - For resources that are already loaded when the listener is added (LoadStatus is LOADED or FAILED_TO_LOAD): The listener will be called immediately, on the current thread.
 
Alternatively, to be notified when there is any change in the load status, add a listener to the
Loadable.loadStatusProperty()instead.- Specified by:
 addDoneLoadingListenerin interfaceLoadable- Parameters:
 listener- a Runnable that is invoked upon completion of the load operation- Since:
 - 100.1.0
 
 - 
removeDoneLoadingListener
Description copied from interface:LoadableRemoves a done loading listener from the loadable resource.- Specified by:
 removeDoneLoadingListenerin interfaceLoadable- Parameters:
 listener- the listener to be removed- Returns:
 - true if the listener was removed, otherwise false
 - Since:
 - 100.1.0
 
 - 
addLoadStatusChangedListener
Description copied from interface:LoadableAdds aLoadStatusChangedListenerto the loadable resource that is invoked whenever the load status changes.Adding this listener on the UI thread will cause it to be invoked on the UI thread, otherwise it is not guaranteed on which thread the listener is invoked.
The listener will not be called if added to a loadable resource that has already completed loading. To be notified when a loadable resource has completed loading, including if the resource is already loaded when the listener is added, use the
Loadable.addDoneLoadingListener(Runnable)method.- Specified by:
 addLoadStatusChangedListenerin interfaceLoadable- Parameters:
 listener- theLoadStatusChangedListenerto be added- Since:
 - 100.1.0
 
 - 
removeLoadStatusChangedListener
Description copied from interface:LoadableRemoves aLoadStatusChangedListenerfrom the loadable resource.- Specified by:
 removeLoadStatusChangedListenerin interfaceLoadable- Parameters:
 listener- theLoadStatusChangedListenerto be removed- Returns:
 - true if the listener was removed, otherwise false
 - Since:
 - 100.1.0
 
 - 
loadStatusProperty
Description copied from interface:LoadableThe load status.- Specified by:
 loadStatusPropertyin interfaceLoadable- Returns:
 - the 
loadStatusproperty - See Also:
 
 - 
loadErrorProperty
Description copied from interface:LoadableThe load error.- Specified by:
 loadErrorPropertyin interfaceLoadable- Returns:
 - the 
loadErrorproperty - See Also:
 
 - 
setCredential
Sets the credential used to authenticate the user with the sublayer.- Specified by:
 setCredentialin interfaceRemoteResource- Parameters:
 credential- the credential used to authenticate the user with the sublayer- Since:
 - 100.1.0
 
 - 
getCredential
Gets the credential used to authenticate the user with the sublayer.- Specified by:
 getCredentialin interfaceRemoteResource- Returns:
 - the credential used to authenticate the user with the sublayer
 - Since:
 - 100.1.0
 
 - 
setRequestConfiguration
Sets the configuration parameters used for sending a network request using this sublayer object. The global RequestConfiguration is used if no RequestConfiguration is set or null is set (seeRequestConfiguration.getGlobalRequestConfiguration()).- Specified by:
 setRequestConfigurationin interfaceRemoteResource- Parameters:
 requestConfiguration- a RequestConfiguration containing the parameters to use- Since:
 - 100.1.0
 
 - 
getRequestConfiguration
Gets the RequestConfiguration in use by this sublayer. If null is returned, it indicates that the global RequestConfiguration is used instead.- Specified by:
 getRequestConfigurationin interfaceRemoteResource- Returns:
 - the RequestConfiguration, or null if none is set
 - Since:
 - 100.1.0
 
 - 
getUri
Gets the URL for this sublayer.- Specified by:
 getUriin interfaceRemoteResource- Returns:
 - the URL, or null if the sublayer is not loaded
 - Since:
 - 100.1.0
 
 - 
copy
Creates a deep copy of this ArcGISSublayer instance.- Returns:
 - a deep copy of this ArcGISSublayer instance
 - Since:
 - 100.1.0
 
 - 
copyTo
Copies fields in this class to the copy instance.- Parameters:
 copy- instance to copy the fields of this class to- Since:
 - 100.1.0
 
 
 -