TileCache Class

  • TileCache
  • class Esri::ArcGISRuntime::TileCache

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

    Header: #include <TileCache.h>
    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
    QByteArray tileData(const Esri::ArcGISRuntime::TileKey &tileKey) 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 for infrequent changes to contextual layers when network access is limited or non-existent. Use ExportTileCacheJob to create and download a local tile cache to a device. Alternatively, the cache can be provisioned directly to local storage. The supported types of cache file formats 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. An offline ArcGISTiledElevationSource can also be created from an appropriate tile cache and added to the Scene::baseSurface of a Scene.

    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.

    QByteArray TileCache::tileData(const Esri::ArcGISRuntime::TileKey &tileKey) const

    Returns the tile data for the specified tile key.

    • tileKey - The tile key.

    This function was introduced in Esri::ArcGISRuntime 100.14.

    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.

    Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.