Skip To Content ArcGIS for Developers Sign In Dashboard

ServiceImageTiledLayer Class

class Esri::ArcGISRuntime::ServiceImageTiledLayer

A base class for all image tiled layers that fetch map tiles from a remote service. More...

Header: #include <ServiceImageTiledLayer>
Since: Esri::ArcGISRuntime 100.1
Inherits: Esri::ArcGISRuntime::ImageTiledLayer and Esri::ArcGISRuntime::RemoteResource
Inherited By:

Esri::ArcGISRuntime::BingMapsLayer and Esri::ArcGISRuntime::WebTiledLayer

This class was introduced in Esri::ArcGISRuntime 100.1.

Public Functions

ServiceImageTiledLayer(const Esri::ArcGISRuntime::TileInfo &tileInfo, const Esri::ArcGISRuntime::Envelope &fullExtent, Esri::ArcGISRuntime::Credential *credential, QObject *parent = nullptr)
ServiceImageTiledLayer(const Esri::ArcGISRuntime::TileInfo &tileInfo, const Esri::ArcGISRuntime::Envelope &fullExtent, QObject *parent = nullptr)
virtual ~ServiceImageTiledLayer() override

Reimplemented Public Functions

virtual Esri::ArcGISRuntime::Credential *credential() const override
virtual Esri::ArcGISRuntime::RequestConfiguration requestConfiguration() const override
virtual void setRequestConfiguration(const Esri::ArcGISRuntime::RequestConfiguration &requestConfiguration) override
virtual QUrl url() const override

Signals

void tileUrlRequest(const Esri::ArcGISRuntime::TileKey &tileKey)

Protected Functions

void setTileUrl(const Esri::ArcGISRuntime::TileKey &tileKey, const QUrl &url)

Detailed Description

This is an abstract class that must be derived to implement your own service tile data scheme.

Creating a custom service image tiled layer

To implement your own custom ServiceImageTiledLayer, for example to load your own online tiles, you should derive from this type and supply the URL for each tile as it is requested.

To do this, connect to the tileUrlRequest signal and call the protected method setTileUrl for each TileKey which is requested:

The tile info parameter defines the format of images (image format, DPI, width and height) returned by remote service, and the limits of extent and scale factor for requests.

CustomServiceTiledLayer::CustomServiceTiledLayer(const TileInfo& tileInfo, const Envelope& fullExtent, QObject* parent) :
  ServiceImageTiledLayer(tileInfo, fullExtent, parent)
{
  connect(this, &CustomServiceTiledLayer::tileUrlRequest, this, [this](const TileKey& tileKey)
  {
    setTileUrl(tileKey, QUrl(QString("http://tile.openstreetmap.org/%1/%2/%3.png").arg(
                          QString::number(tileKey.level()),
                          QString::number(tileKey.column()),
                          QString::number(tileKey.row()))));
  });
}

Network requesting, downloading images and rendering are done internally.

Note: The URL supplied must be a valid online image URL. If the URL is not valid or if the image format doesn't match the tile info, ServiceImageTiledLayer will emit an error.

See also TileInfo.

Member Function Documentation

ServiceImageTiledLayer::ServiceImageTiledLayer(const Esri::ArcGISRuntime::TileInfo &tileInfo, const Esri::ArcGISRuntime::Envelope &fullExtent, Esri::ArcGISRuntime::Credential *credential, QObject *parent = nullptr)

Constructor that accepts a tile info (tileInfo), an extent (fullExtent), a credential, and an optional parent.

This function was introduced in Esri::ArcGISRuntime 100.2.

ServiceImageTiledLayer::ServiceImageTiledLayer(const Esri::ArcGISRuntime::TileInfo &tileInfo, const Esri::ArcGISRuntime::Envelope &fullExtent, QObject *parent = nullptr)

Constructor that accepts a tile info (tileInfo), an extent (fullExtent), and an optional parent.

This function was introduced in Esri::ArcGISRuntime 100.2.

[signal] void ServiceImageTiledLayer::tileUrlRequest(const Esri::ArcGISRuntime::TileKey &tileKey)

Signal emitted when a tile URL is requested.

  • tileKey - The key used to identify the specific tile.

Note: : React to this signal when implementing your own custom service image tiled layer type.

This function was introduced in Esri::ArcGISRuntime 100.2.

[override virtual] ServiceImageTiledLayer::~ServiceImageTiledLayer()

Destructor.

[override virtual] Esri::ArcGISRuntime::Credential *ServiceImageTiledLayer::credential() const

Reimplements: RemoteResource::credential() const.

Returns the security credential used to access the layer. Only applicable if the service is secured.

[override virtual] Esri::ArcGISRuntime::RequestConfiguration ServiceImageTiledLayer::requestConfiguration() const

Reimplements: RemoteResource::requestConfiguration() const.

Returns the RequestConfiguration in use by this layer.

See also setRequestConfiguration().

[override virtual] void ServiceImageTiledLayer::setRequestConfiguration(const Esri::ArcGISRuntime::RequestConfiguration &requestConfiguration)

Reimplements: RemoteResource::setRequestConfiguration(const Esri::ArcGISRuntime::RequestConfiguration &requestConfiguration).

Sets requestConfiguration used for network requests sent by this layer.

See also requestConfiguration().

[protected] void ServiceImageTiledLayer::setTileUrl(const Esri::ArcGISRuntime::TileKey &tileKey, const QUrl &url)

Set the URL corresponding to the requested tileKey to url.

Note: This function should only be called when implementing your own custom service image tiled layer type.

This function was introduced in Esri::ArcGISRuntime 100.2.

[override virtual] QUrl ServiceImageTiledLayer::url() const

Reimplements: RemoteResource::url() const.

Not implemented for ServiceImageTiledLayer.


Feedback on this topic?