- All Implemented Interfaces:
ApiKeyResource
,RemoteResource
,LayerContent
,Loadable
TileCache
by using previously generated
tiles.
ArcGIS tiled layers consume image tiles provided by an ArcGIS map service or a local tile package. Raster tiles are cached at various scales when the map service is created. This API requests the tiles needed at a particular map extent. ArcGISTiledLayer will display data from an ArcGIS MapServer if "Single Fused Map Cache" is set to true in its ArcGIS REST Services Directory.
You can use the ExportTileCacheTask
class to generate and download tiles from the service, creating a
tile package (.tpk/.tpkx) for use locally on the device. Alternatively, you can use ArcGIS Pro to create a
map tile package and provision it to the device.
Functional characteristics
ArcGIS tiled layers do not support re-projection, query, select, identify, or editing.
Performance characteristics
Tiled image layers (those that derive functionality from the ImageTiledLayer
class) provide
fast display of geographic imagery stored in raster files. These rasters typically contain
image data acquired from satellite, aircraft, or drones. The resolution of such imagery can be
very high, providing a detailed view. With increased resolution comes increased file sizes and
potentially slower performance.
Raster tiling is a process that resamples the pixel size at different scales to create images with the appropriate resolution for each scale. The tiling process creates level-of-detail pyramids to efficiently manage how much detail you see as you zoom in and out on the map. Typically, as you zoom closer to the Earth's surface, you want to see greater detail of the geographic information. Tiled image layers allow you to see just the information you need very quickly based on the level-of-detail pyramid at a particular scale, rather than having to load a single large image at once.
Tiles are generated by the server when the service is created. Requests for tiles are made on multiple threads and handled asynchronously. The size of each returned tile increases as the resolution or complexity of the image in the tile increases. For example, high-resolution imagery tiles can be result in larger file sizes than topographic mapping for the same area and map extent.
- Since:
- 100.0.0
- See Also:
-
Property Summary
Properties inherited from class com.esri.arcgisruntime.layers.Layer
loadError, loadStatus
-
Nested Class Summary
Nested classes/interfaces inherited from class com.esri.arcgisruntime.layers.ImageTiledLayer
ImageTiledLayer.BufferSize, ImageTiledLayer.NoDataTileBehavior
-
Constructor Summary
ConstructorDescriptionArcGISTiledLayer
(TileCache tileCache) Creates an ArcGIS Tiled Layer object from a local cache of previously rendered map tiles.ArcGISTiledLayer
(PortalItem portalItem) Creates an ArcGIS tiled layer from aPortalItem
representing an ArcGIS map service.ArcGISTiledLayer
(String url) Creates an ArcGIS tiled layer from the specified URL. -
Method Summary
Modifier and TypeMethodDescriptioncopy()
Creates a deep copy of this ArcGISTiledLayer instance.Gets the API key to access API key enabled services and resources in ArcGIS Online.Gets the credential used to authenticate the user with the tiled layer.Gets the ArcGIS map service information.long
Gets the refresh interval in milliseconds.Gets the RequestConfiguration object in use by this Layer.Gets the read-only collection sublayers in an ArcGIS tiled layer.protected byte[]
Gets the encoded bytes that represents a tile for the given tile key.Gets the local tiled cache.getUri()
Gets the URL to the endpoint of an ArcGIS map service or the path to a local tile package (.tpk/.tpkx) file.void
Sets the API key to access API key enabled services and resources in ArcGIS Online.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.Methods inherited from class com.esri.arcgisruntime.layers.ImageTiledLayer
getBufferSize, getNoDataTileBehavior, getTileInfo, setBufferSize, setNoDataTileBehavior
Methods inherited from class com.esri.arcgisruntime.layers.ImageAdjustmentLayer
getBrightness, getContrast, getGamma, setBrightness, setContrast, setGamma
Methods inherited from class com.esri.arcgisruntime.layers.Layer
addDoneLoadingListener, addLoadStatusChangedListener, addVisibilityChangedListener, cancelLoad, canChangeVisibility, canShowInLegend, fetchLegendInfosAsync, getAttribution, getDescription, getFullExtent, getId, getItem, getLoadError, getLoadStatus, getMaxScale, getMinScale, getName, getOpacity, getSpatialReference, getSubLayerContents, isIdentifyEnabled, isVisible, isVisibleAtScale, loadAsync, loadErrorProperty, loadStatusProperty, removeDoneLoadingListener, removeLoadStatusChangedListener, removeVisibilityChangedListener, retryLoadAsync, setCanShowInLegend, setDescription, setId, setMaxScale, setMinScale, setName, setOpacity, setVisible
-
Constructor Details
-
ArcGISTiledLayer
Creates an ArcGIS tiled layer from aPortalItem
representing an ArcGIS map service.The item's type should be
PortalItem.Type.MAP_SERVICE
.- Parameters:
portalItem
- a portal item of typePortalItem.Type.MAP_SERVICE
.- Throws:
IllegalArgumentException
- if portalItem is null- Since:
- 100.0.0
-
ArcGISTiledLayer
Creates an ArcGIS tiled layer from the specified URL.If the specified URI is a map service URL, the MapServer must have "Single Fused Map Cache" set to true in its ArcGIS REST Services Directory. If the specified URI is a portal item URL, the underlying
PortalItem
is created and can be accessed throughLayer.getItem()
.- Parameters:
url
- the URL to the REST endpoint of an ArcGIS map service or ArcGIS map service portal item, or the path to a local tile package(.tpk/.tpkx).- Throws:
IllegalArgumentException
- if the URL is null or empty- Since:
- 100.0.0
- See Also:
-
ArcGISTiledLayer
Creates an ArcGIS Tiled Layer object from a local cache of previously rendered map tiles.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- Since:
- 100.0.0
-
-
Method Details
-
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
- Since:
- 100.1.0
-
getTileCache
Gets the local tiled cache.This property is populated if the ArcGISTiledLayer has been loaded from a local tile package (.tpk/.tpkx).
- Returns:
- the tile cache of this tiled layer or null if this layer references an online service
- Since:
- 100.9.0
- See Also:
-
getRefreshInterval
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
- Since:
- 100.1.0
-
setRefreshInterval
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- Since:
- 100.1.0
-
setCredential
Sets the credential used to authenticate the user with the tiled layer.- Specified by:
setCredential
in interfaceRemoteResource
- Parameters:
credential
- the credential used to authenticate the user with the tiled layer- Since:
- 100.0.0
-
getCredential
Gets the credential used to authenticate the user with the tiled layer.- Specified by:
getCredential
in interfaceRemoteResource
- Returns:
- the credential used to authenticate the user with the tiled layer
- Since:
- 100.0.0
-
setRequestConfiguration
Sets configuration parameters used for network requests sent using this Layer object. The global RequestConfiguration is used if no RequestConfiguration is set.- Specified by:
setRequestConfiguration
in interfaceRemoteResource
- Parameters:
requestConfiguration
- object containing the parameters to use- Since:
- 100.0.0
-
getRequestConfiguration
Gets the RequestConfiguration object in use by this Layer.- Specified by:
getRequestConfiguration
in interfaceRemoteResource
- Returns:
- the RequestConfiguration object or null if none has been set
- Since:
- 100.0.0
- See Also:
-
getUri
Gets the URL to the endpoint of an ArcGIS map service or the path to a local tile package (.tpk/.tpkx) file.The URI is available after the layer has successfully loaded.
- Specified by:
getUri
in interfaceRemoteResource
- Returns:
- the URI of the map service, or null if none
- Since:
- 100.0.0
-
getMapServiceInfo
Gets the ArcGIS map service information.This information is available after the layer has successfully loaded.
- Returns:
- map service information for this layer
- Since:
- 100.0.0
-
getSublayers
Gets the read-only collection sublayers in an ArcGIS tiled layer.- Returns:
- the read-only collection sublayers in an ArcGIS tiled layer
- Since:
- 100.2.0
-
getApiKey
Description copied from interface:ApiKeyResource
Gets the API key to access API key enabled services and resources in ArcGIS Online.An API key is a unique long-lived access token that is used to authenticate and monitor requests to ArcGIS location services and private portal items. You can create and manage an API key using your portal when you sign in with an ArcGIS Location Platform account or an ArcGIS Online account with administrator access or a custom role that has the Generate API keys privilege. To learn how to create and manage API keys, go to the Create an API Key tutorial. You must ensure that your API key has the correct privileges to access secure resources.
In addition to setting an API key at a global level for your application using
ArcGISRuntimeEnvironment.setApiKey(String)
, you can callApiKeyResource.setApiKey(String)
on any class that implementsApiKeyResource
. When you callsetApiKey(String)
on anAPIKeyResource
, it will override the default key at the global level (the key returned byArcGISRuntimeEnvironment.getApiKey()
, in other words), enabling more granular usage telemetry and management for ArcGIS Online resources used by your app.Classes that expose an API key property by implementing APIKeyResource include:
- Specified by:
getApiKey
in interfaceApiKeyResource
- Returns:
- the API key to access API key enabled services and resources in ArcGIS Online
- See Also:
-
setApiKey
Description copied from interface:ApiKeyResource
Sets the API key to access API key enabled services and resources in ArcGIS Online.An API key is a unique key used to authorize access to specific services and resources in ArcGIS Online. It is also used to monitor access to those services. An API key is created and managed in the ArcGIS developer dashboard and is tied to a specific ArcGIS account.
In addition to setting an API key at a global level for your application using
ArcGISRuntimeEnvironment.setApiKey(String)
, you can callsetApiKey(String)
on any class that implementsApiKeyResource
. When you callsetApiKey(String)
on anAPIKeyResource
, it will override the default key at the global level (the key returned byArcGISRuntimeEnvironment.getApiKey()
, in other words), enabling more granular usage telemetry and management for ArcGIS Online resources used by your app.Classes that expose an API key property by implementing APIKeyResource include:
- Specified by:
setApiKey
in interfaceApiKeyResource
- Parameters:
apiKey
- the API key to access API key enabled services and resources in ArcGIS Online- See Also:
-
getTile
Description copied from class:ImageTiledLayer
Gets the encoded bytes that represents a tile for the given tile key. The encoding must matchTileInfo
specified in the constructorImageTiledLayer(TileInfo, Envelope)
.- Specified by:
getTile
in classImageTiledLayer
- Parameters:
tileKey
- key for the expected tile- Returns:
- the encoded bytes that represent the tile for the given tile key
-