Skip To Content ArcGIS for Developers Sign In Dashboard

WmtsService Class


An Open Geospatial Consortium (OGC) Web Map Tile Service (WMTS). More...

Header: #include <WmtsService>
Since: Esri::ArcGISRuntime 100.1
Inherits: Object, Loadable, and RemoteResource

Public Functions

WmtsService(const QUrl &url, QObject *parent = nullptr)
WmtsService(const QUrl &url, Credential *credential, QObject *parent = nullptr)
QMap<QString, QString> customParameters() const
WmtsServiceInfo serviceInfo() const
void setCustomParameters(const QMap<QString, QString> &customParameters)

Reimplemented Public Functions

virtual void cancelLoad()
virtual Credential *credential() const
virtual void load()
virtual Error loadError() const
virtual LoadStatus loadStatus() const
virtual RequestConfiguration requestConfiguration() const
virtual void retryLoad()
virtual void setRequestConfiguration(const RequestConfiguration &requestConfiguration)
virtual QUrl url() const


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

Additional Inherited Members

  • 1 property inherited from QObject
  • 1 public slot inherited from QObject
  • 1 public variable inherited from QObject
  • 10 static public members inherited from QObject
  • 9 protected functions inherited from QObject
  • 2 protected variables inherited from QObject

Detailed Description

An Open Geospatial Consortium (OGC) Web Map Tile Service (WMTS).

The OGC WMTS standard describes an implementation for serving maps using predefined tiles. The WMTS service may be hosted in the cloud on ArcGIS Online, on a third-party server, or on-premises with ArcGIS Server.

The WmtsService is constructed using the URL of the service and once the load task completes (see Loadable) allows the user to browse for predefined content via the serviceInfo.

A WMTS service provides access to a set of cached tiles at predefined scales. The service provides one or more tile matrix sets, each of which which is composed of one or more tile matrices for a series of fixed scales. As the scale descreases, the number of tiles in the matrix increases - each tile being of a smaller geographic area and of a higher resolution.

A WMTS service may also host several layers, each of which can be described by a WmtsLayerInfo.

Example: List the WMTS layers available in a service:

QUrl wmtsUrl("");
WmtsService* service = new WmtsService(wmtsUrl, parent);

connect(service, &WmtsService::doneLoading, parent, [service, map, parent](Esri::ArcGISRuntime::Error loadError)
  if (!loadError.isEmpty())
    qDebug() << loadError.message() << ": " << loadError.additionalMessage();

  if (service->loadStatus() != LoadStatus::Loaded)

  // get the service info for the service
  WmtsServiceInfo serviceInfo = service->serviceInfo();

  // create a WmtsLayer for each layer in the service
  QList<WmtsLayerInfo> layerInfos = serviceInfo.layerInfos();
  for (const WmtsLayerInfo& layerInfo : layerInfos)
    WmtsLayer* wmtsLayer = new WmtsLayer(layerInfo, parent);

See also Loadable, WmtsLayerInfo, and WmtsLayer.

Member Function Documentation

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

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

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

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

  • url. The URL of the WMTS service.
  • credential. The credential.
  • parent. The parent object for this WmtsService (optional).



[virtual] void WmtsService::cancelLoad()

Reimplemented from Loadable::cancelLoad().

See Loadable.

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

Reimplemented from RemoteResource::credential().

Returns the security credential used to access this WmtsService.

Only applicable if the service is secured.

QMap<QString, QString> WmtsService::customParameters() const

Returns custom parameters to append to GetCapabilities and GetTile requests.

This function was introduced in Esri::ArcGISRuntime 100.6.

See also setCustomParameters.

[signal] void WmtsService::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.

[virtual] void WmtsService::load()

Reimplemented from Loadable::load().

See Loadable.

[virtual] Error WmtsService::loadError() const

Reimplemented from Loadable::loadError().

See Loadable.

[virtual] LoadStatus WmtsService::loadStatus() const

Reimplemented from Loadable::loadStatus().

See Loadable.

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

Signal emitted when the load status changes for this object.

See also Loadable.

[virtual] RequestConfiguration WmtsService::requestConfiguration() const

Reimplemented from RemoteResource::requestConfiguration().

Returns the RequestConfiguration in use by this task.

See also setRequestConfiguration().

[virtual] void WmtsService::retryLoad()

Reimplemented from Loadable::retryLoad().

See Loadable.

WmtsServiceInfo WmtsService::serviceInfo() const

Returns the service info for this service.

A WmtsServiceInfo provides the information for browsing and accessing the service contents.

void WmtsService::setCustomParameters(const QMap<QString, QString> &customParameters)

Sets customParameters to append to GetCapabilities and GetTile requests.

If a parameter with the same name is defined in a layer's custom parameters, then layer-specific values take precedence over service-wide values.

Parameters intended for GetCapabilities requests should be set before the service is loaded.

This function was introduced in Esri::ArcGISRuntime 100.6.

See also customParameters().

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

Reimplemented from RemoteResource::setRequestConfiguration().

Sets configuration parameters used for network requests sent by this task to requestConfiguration.

See also requestConfiguration().

[virtual] QUrl WmtsService::url() const

Reimplemented from RemoteResource::url().

Returns the URL of this WmtsService.

Feedback on this topic?