public final class

ArcGISTiledLayer

extends ImageTiledLayer
implements RemoteResource
java.lang.Object
   ↳ com.esri.arcgisruntime.layers.Layer
     ↳ com.esri.arcgisruntime.layers.ImageAdjustmentLayer
       ↳ com.esri.arcgisruntime.layers.ImageTiledLayer
         ↳ com.esri.arcgisruntime.layers.ArcGISTiledLayer

Class Overview

Represents a layer that allows you to display data from a ArcGIS Map service by using pre-generated tiles.

Summary

Public Constructors
ArcGISTiledLayer(PortalItem portalItem)
Creates a new ArcGISTiledLayer based on a map service PortalItem.
ArcGISTiledLayer(String url)
Creates a new ArcGIS tiled layer from a map service or map service portal item at the given URL.
ArcGISTiledLayer(TileCache tileCache)
Creates a new ArcGIS tiled layer from a tile cache.
Public Methods
ArcGISTiledLayer copy()
Creates a deep copy of this ArcGISTiledLayer instance.
Credential getCredential()
Gets the credential used to authenticate the user with the tiled layer.
ArcGISMapServiceInfo getMapServiceInfo()
Gets the map service information for this layer.
long getRefreshInterval()
Gets the refresh interval in milliseconds.
RequestConfiguration getRequestConfiguration()
Gets the RequestConfiguration object in use by this Layer.
ListenableList<ArcGISSublayer> getSublayers()
Gets the sublayers for this layer.
String getUri()
Gets the URL of the tiled layer.
void setCredential(Credential credential)
Sets the credential used to authenticate the user with the tiled layer.
void setRefreshInterval(long refreshIntervalMilliseconds)
Sets the refresh interval in milliseconds.
void setRequestConfiguration(RequestConfiguration requestConfiguration)
Sets configuration parameters used for network requests sent using this Layer object.
Protected Methods
byte[] getTile(TileKey tileKey)
Gets the encoded bytes that represents a tile for the given tile key.
[Expand]
Inherited Methods
From class com.esri.arcgisruntime.layers.ImageTiledLayer
From class com.esri.arcgisruntime.layers.ImageAdjustmentLayer
From class com.esri.arcgisruntime.layers.Layer
From class java.lang.Object
From interface com.esri.arcgisruntime.io.RemoteResource
From interface com.esri.arcgisruntime.layers.LayerContent
From interface com.esri.arcgisruntime.loadable.Loadable

Public Constructors

public ArcGISTiledLayer (PortalItem portalItem)

Creates a new ArcGISTiledLayer based on a map service PortalItem.

If the portal item argument is not in LoadStatus#LOADED state it will be loaded automatically when this ArcGISTiledLayer instance is loaded.

Parameters
portalItem a map service PortalItem
Throws
IllegalArgumentException if portalItem is null

public ArcGISTiledLayer (String url)

Creates a new ArcGIS tiled layer from a map service or map service portal item at the given URL.

To use a credential, call setCredential(Credential) after this constructor and before loading or using this layer.

Parameters
url the map service or portal item URL
Throws
IllegalArgumentException if the URL is null or empty

public ArcGISTiledLayer (TileCache tileCache)

Creates a new ArcGIS tiled layer from a tile cache.

The supported file formats:

  • Tiled Package .tpk, which holds data about tiles (images) from an ArcGISMap wrapped in a single file.
  • Exploded Cache, where each tile is stored in a single file.
  • Compact Cache, where groups of tiles are stored together in large files called bundles.

Can be used to work with tiled layers offline.

Parameters
tileCache the tile cache to use
Throws
IllegalArgumentException if argument is null

Public Methods

public ArcGISTiledLayer copy ()

Creates a deep copy of this ArcGISTiledLayer instance.

Returns
  • a deep copy of this ArcGISTiledLayer instance, which means that copies of all fields of this layer are made including its loading state

public Credential getCredential ()

Gets the credential used to authenticate the user with the tiled layer.

Returns
  • the credential used to authenticate the user with the tiled layer

public ArcGISMapServiceInfo getMapServiceInfo ()

Gets the map service information for this layer.

Returns
  • map service information for this layer

public long getRefreshInterval ()

Gets the refresh interval in milliseconds. The refresh interval is the time between automatic layer requests. A value of zero means the layer is never refreshed. The default value is zero.

Returns
  • the refresh interval in milliseconds

public RequestConfiguration getRequestConfiguration ()

Gets the RequestConfiguration object in use by this Layer.

Returns
  • the RequestConfiguration object or null if none has been set

public ListenableList<ArcGISSublayer> getSublayers ()

Gets the sublayers for this layer.

Returns
  • an unmodifiable list of ArcGISSublayers

public String getUri ()

Gets the URL of the tiled layer.

Returns
  • the URL of the tiled layer

public void setCredential (Credential credential)

Sets the credential used to authenticate the user with the tiled layer.

Parameters
credential the credential used to authenticate the user with the tiled layer

public void setRefreshInterval (long refreshIntervalMilliseconds)

Sets the refresh interval in milliseconds. The refresh interval is the time between automatic layer requests. A value of zero means the layer is never refreshed. The default value is zero.

Parameters
refreshIntervalMilliseconds the refresh interval in milliseconds
Throws
IllegalArgumentException if milliseconds is less than zero

public void setRequestConfiguration (RequestConfiguration requestConfiguration)

Sets configuration parameters used for network requests sent using this Layer object. The global RequestConfiguration is used if no RequestConfiguration is set.

Parameters
requestConfiguration object containing the parameters to use

Protected Methods

protected byte[] getTile (TileKey tileKey)

Gets the encoded bytes that represents a tile for the given tile key. The encoding must match TileInfo specified in the constructor ImageTiledLayer(TileInfo, Envelope).

Parameters
tileKey key for the expected tile
Returns
  • the encoded bytes that represent the tile for the given tile key