Skip To Content ArcGIS for Developers Sign In Dashboard

ArcGISTiledLayer Class

(Esri::ArcGISRuntime::ArcGISTiledLayer)

A layer that displays ArcGIS tiled map services and cached image services. More...

Header: #include <ArcGISTiledLayer>
Since: Esri::ArcGISRuntime 100.0
Inherits: ImageTiledLayer and RemoteResource

Public Functions

ArcGISTiledLayer(const QUrl &url, QObject *parent = nullptr)
ArcGISTiledLayer(const QUrl &url, Credential *credential, QObject *parent = nullptr)
ArcGISTiledLayer(Item *item, QObject *parent = nullptr)
ArcGISTiledLayer(TileCache *tileCache, QObject *parent = nullptr)
~ArcGISTiledLayer()
ArcGISMapServiceInfo mapServiceInfo() const
quint64 refreshInterval() const
void setRefreshInterval(quint64 milliseconds)
TileCache *tileCache() const
QList<ArcGISSublayer *> tiledSublayers() const

Reimplemented Public Functions

virtual Credential *credential() const
virtual RequestConfiguration requestConfiguration() const
virtual void setRequestConfiguration(const RequestConfiguration &requestConfiguration)
virtual QUrl url() const

Additional Inherited Members

Detailed Description

A layer that displays ArcGIS tiled map services and cached image services.

An ArcGISTiledLayer displays map content from a tiled ArcGIS map service or an image service, both of which contain pre-generated raster tiles. The number and content of these map tiles is defined by the service's tiling scheme and the map document that the service is based upon. The tiling scheme specifies parameters such as tile dimensions, image format, scale levels, and so on. As you navigate the map, the layer fetches new map tiles to be displayed.

An ArcGISTiledLayer's spatial reference must match the map's spatial reference. This is necessary because tiled layers display pre-generated map tiles that cannot be reprojected to match a different spatial reference.

Unlike ArcGISMapImageLayers, you cannot modify properties of an ArcGISTiledLayer to alter map contents. This is because the layer relies on a cached map service that does not create map images on-the-fly like a dynamic map service does.

To construct an ArcGISTiledLayer, provide a URL to a map or image service's REST web service endpoint. You should verify that the service is indeed cached by checking that Single Fused Map Cache property in the Services Directory is set to true. An ArcGISTiledLayer will not work with map services that are not cached.

Alternatively, you can construct an ArcGISTiledLayer with a TileCache or path to a local tile cache.

Example:

Create an ArcGISTiledLayer from a URL to the REST endpoint of an tiled map service:

// create a new tiled layer
ArcGISTiledLayer* tiledLayer = new ArcGISTiledLayer(QUrl("https://services.arcgisonline.com/arcgis/rest/services/NatGeo_World_Map/MapServer"), this);
// create a new basemap instance with the tiled layer
Basemap* basemap = new Basemap(tiledLayer, this);
// create a new map instance
m_map = new Map(basemap, this);
// set map on the map view
m_mapView->setMap(m_map);

Alternatively, you can display tiles offline by creating an ArcGISTiledLayer from a local tile package (*.tpk):

TileCache* tileCache = new TileCache(m_dataPath + "tpk/SanFrancisco.tpk", this);
ArcGISTiledLayer* tiledLayer = new ArcGISTiledLayer(tileCache, this);
Basemap* basemap = new Basemap(tiledLayer, this);
m_map = new Map(basemap, this);

Member Function Documentation

ArcGISTiledLayer::ArcGISTiledLayer(const QUrl &url, QObject *parent = nullptr)

Constructor that accepts a URL (url) and an optional parent.

The URL can be to either an online service or a local tile cache.

ArcGISTiledLayer::ArcGISTiledLayer(const QUrl &url, Credential *credential, QObject *parent = nullptr)

Constructor that accepts the URL (url), a credential, and an optional parent.

Credential are applied if the provided URL is to a secured service.

ArcGISTiledLayer::ArcGISTiledLayer(Item *item, QObject *parent = nullptr)

Constructor that accepts an item (item) and an optional parent.

ArcGISTiledLayer::ArcGISTiledLayer(TileCache *tileCache, QObject *parent = nullptr)

Constructor that accepts a TileCache (tileCache) and an optional parent.

ArcGISTiledLayer::~ArcGISTiledLayer()

Destructor.

[virtual] Credential *ArcGISTiledLayer::credential() const

Reimplemented from RemoteResource::credential().

Returns the security credential used to access the tiled service.

The credential is available if the service is secured.

ArcGISMapServiceInfo ArcGISTiledLayer::mapServiceInfo() const

Gets information about the service.

quint64 ArcGISTiledLayer::refreshInterval() const

Returns the refresh interval used by the layer, in milliseconds.

Layers request tiles from the service each time this interval elapses.

A value of 0 means to never refresh.

This function was introduced in Esri::ArcGISRuntime 100.1.

See also setRefreshInterval().

[virtual] RequestConfiguration ArcGISTiledLayer::requestConfiguration() const

Reimplemented from RemoteResource::requestConfiguration().

Returns the RequestConfiguration in use by this layer.

This function was introduced in Esri::ArcGISRuntime 100.1.

See also setRequestConfiguration().

void ArcGISTiledLayer::setRefreshInterval(quint64 milliseconds)

Sets the refresh interval used by the layer to milliseconds.

Layers request tiles from the service each time this interval elapses.

A value of 0 means to never refresh.

This function was introduced in Esri::ArcGISRuntime 100.1.

See also refreshInterval().

[virtual] void ArcGISTiledLayer::setRequestConfiguration(const RequestConfiguration &requestConfiguration)

Reimplemented from RemoteResource::setRequestConfiguration().

Sets requestConfiguration used for network requests sent by this layer.

This function was introduced in Esri::ArcGISRuntime 100.1.

See also requestConfiguration().

TileCache *ArcGISTiledLayer::tileCache() const

Gets the local tile cache.

Returns the TileCache, but only if this ArcGISTiledLayer was created from a local tile cache.

QList<ArcGISSublayer *> ArcGISTiledLayer::tiledSublayers() const

Gets a list of sublayers contained in the service.

[virtual] QUrl ArcGISTiledLayer::url() const

Reimplemented from RemoteResource::url().

Gets the URL of the layer's source.

The URL can refer to an online service or a path to a local tile cache.


Feedback on this topic?