Skip To Content ArcGIS for Developers Sign In Dashboard

WmtsService Class

class Esri::ArcGISRuntime::WmtsService

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

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

This class was introduced in Esri::ArcGISRuntime 100.1.

Public Functions

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

Reimplemented Public Functions

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

Signals

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

Detailed Description

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("http://sampleserver6.arcgisonline.com/arcgis/rest/services/WorldTimeZones/MapServer/WMTS");
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)
    return;

  // 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);
    map->operationalLayers()->append(wmtsLayer);
  }
});

See also Loadable, WmtsLayerInfo, and WmtsLayer.

Member Function Documentation

WmtsService::WmtsService(const QUrl &url, Esri::ArcGISRuntime::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).

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

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

[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.

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

Signal emitted when the load status changes for this object.

See also Loadable.

[override virtual] WmtsService::~WmtsService()

Destructor.

[override virtual] void WmtsService::cancelLoad()

Reimplements: Loadable::cancelLoad().

See Loadable.

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

Reimplements: RemoteResource::credential() const.

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.

[override virtual] void WmtsService::load()

Reimplements: Loadable::load().

See Loadable.

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

Reimplements: Loadable::loadError() const.

See Loadable.

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

Reimplements: Loadable::loadStatus() const.

See Loadable.

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

Reimplements: RemoteResource::requestConfiguration() const.

Returns the RequestConfiguration in use by this task.

See also setRequestConfiguration().

[override virtual] void WmtsService::retryLoad()

Reimplements: Loadable::retryLoad().

See Loadable.

Esri::ArcGISRuntime::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().

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

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

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

See also requestConfiguration().

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

Reimplements: RemoteResource::url() const.

Returns the URL of this WmtsService.


Feedback on this topic?