Skip To Content ArcGIS for Developers Sign In Dashboard

TileCache Class

class Esri::ArcGISRuntime::TileCache

A local cache of pre-rendered map tiles that can be used to create a layer. More...

Header: #include <TileCache>
Since: Esri::ArcGISRuntime 100.0
Inherits: Esri::ArcGISRuntime::Object and Esri::ArcGISRuntime::Loadable

This class was introduced in Esri::ArcGISRuntime 100.0.

Public Functions

TileCache(const QString &path, QObject *parent = nullptr)
virtual ~TileCache() override
Esri::ArcGISRuntime::CacheStorageFormat cacheStorageFormat() const
Esri::ArcGISRuntime::Envelope fullExtent() const
bool isAntialiasing() const
QString path() const
QImage thumbnail() const
Esri::ArcGISRuntime::TileInfo tileInfo() const

Reimplemented Public Functions

virtual void cancelLoad() override
virtual void load() override
virtual Esri::ArcGISRuntime::Error loadError() const override
virtual Esri::ArcGISRuntime::LoadStatus loadStatus() const override
virtual void retryLoad() override

Signals

void doneLoading(Esri::ArcGISRuntime::Error loadError)
void loadStatusChanged(Esri::ArcGISRuntime::LoadStatus loadStatus)

Detailed Description

Functional characteristics

A tile cache stores a collection of images at various scales. A client can request the tiles needed to display a particular map extent. You can use ExportTileCacheTask to generate and download tiles from a service, thereby creating a tile package (.tpk/.tpkx). Alternatively, you can use ArcGIS Pro to create a map tile package and provision it to the device. ArcGIS tiled layers do not support reprojection, query, select, identify, or editing.

Performance characteristics

Tiles are generated when the cache 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 larger files than topographic mapping for the same area and map extent.

Local tile caches are ideal for providing basemaps or less frequently changing contextual layers, where network access is limited or non-existent. They can be created and downloaded onto a device by using an ExportTileCacheJob, or alternatively can be provisioned directly to local storage. The supported types of cache are:

  • Tile package (.tpk, .tpkx) - a tile cache of data, packaged into one convenient, portable file, ideal for offline sharing of complete tiled layers in a disconnected environment or via a portal.
  • Compact Cache - a directory structure where groups of tiles are combined into larger .bundle files, preserving performance and reducing copy times and the size on disk of the cache.
  • Exploded Cache - a directory structure where map tiles are stored as individual files.

A TileCache is often used as a basemap, but can also be used to create an ArcGISTiledLayer that is added to a map as an operational layer.

See also ArcGISTiledLayer.

Member Function Documentation

TileCache::TileCache(const QString &path, QObject *parent = nullptr)

Constructor that takes a path to a local tile cache and an optional parent.

[signal] void TileCache::doneLoading(Esri::ArcGISRuntime::Error loadError)

Signal emitted when this object is done loading.

  • loadError - Details about any error that may have occurred.

Note: If there is a load error it will also be emitted on the errorOccurred signal.

See also Loadable and Object.

[signal] void TileCache::loadStatusChanged(Esri::ArcGISRuntime::LoadStatus loadStatus)

loadStatus See Loadable.

[override virtual] TileCache::~TileCache()

Destructor.

Esri::ArcGISRuntime::CacheStorageFormat TileCache::cacheStorageFormat() const

Returns the cache storage format of this tile cache.

This function was introduced in Esri::ArcGISRuntime 100.2.

[override virtual] void TileCache::cancelLoad()

Reimplements: Loadable::cancelLoad().

See Loadable.

Esri::ArcGISRuntime::Envelope TileCache::fullExtent() const

Returns the full extent as an Envelope.

Expressed in coordinates of the spatial reference of the source map document.

bool TileCache::isAntialiasing() const

Returns the antialiasing flag of this tile cache.

[override virtual] void TileCache::load()

Reimplements: Loadable::load().

See Loadable.

[override virtual] Esri::ArcGISRuntime::Error TileCache::loadError() const

Reimplements: Loadable::loadError() const.

See Loadable.

[override virtual] Esri::ArcGISRuntime::LoadStatus TileCache::loadStatus() const

Reimplements: Loadable::loadStatus() const.

See Loadable.

QString TileCache::path() const

Returns the path to the local tile cache or tile package this TileCache is referencing.

[override virtual] void TileCache::retryLoad()

Reimplements: Loadable::retryLoad().

See Loadable.

QImage TileCache::thumbnail() const

Gets the thumbnail image of this tile cache.

Esri::ArcGISRuntime::TileInfo TileCache::tileInfo() const

Returns tile info from the local tile cache.

This is only available after the TileCache is loaded.

See also Loadable.


Feedback on this topic?