Skip To Content ArcGIS for Developers Sign In Dashboard

WmtsLayer Class

(Esri::ArcGISRuntime::WmtsLayer)

Defines an Open Geospatial Consortium (OGC) Web Map Tile Service (WMTS) layer. More...

Header: #include <WmtsLayer>
Since: Esri::ArcGISRuntime 100.1
Inherits: ImageTiledLayer and RemoteResource

Public Functions

WmtsLayer(const QUrl &url, const QString &wmtsLayerId, QObject *parent = nullptr)
WmtsLayer(const QUrl &url, const QString &wmtsLayerId, Credential *credential, QObject *parent = nullptr)
WmtsLayer(const QUrl &url, const QString &wmtsLayerId, TileImageFormat preferredImageFormat, QObject *parent = nullptr)
WmtsLayer(const QUrl &url, const QString &wmtsLayerId, TileImageFormat preferredImageFormat, Credential *credential, QObject *parent = nullptr)
WmtsLayer(const QUrl &url, const QString &wmtsLayerId, const QString &tileMatrixSetId, QObject *parent = nullptr)
WmtsLayer(const QUrl &url, const QString &wmtsLayerId, const QString &tileMatrixSetId, Credential *credential, QObject *parent = nullptr)
WmtsLayer(const QUrl &url, const QString &wmtsLayerId, const QString &tileMatrixSetId, TileImageFormat preferredImageFormat, QObject *parent = nullptr)
WmtsLayer(const QUrl &url, const QString &wmtsLayerId, const QString &tileMatrixSetId, TileImageFormat preferredImageFormat, Credential *credential, QObject *parent = nullptr)
WmtsLayer(const WmtsLayerInfo &layerInfo, QObject *parent = nullptr)
WmtsLayer(const WmtsLayerInfo &layerInfo, TileImageFormat preferredImageFormat, QObject *parent = nullptr)
WmtsLayer(const WmtsLayerInfo &layerInfo, const WmtsTileMatrixSet &tileMatrixSet, QObject *parent = nullptr)
WmtsLayer(const WmtsLayerInfo &layerInfo, const WmtsTileMatrixSet &tileMatrixSet, TileImageFormat preferredImageFormat, QObject *parent = nullptr)
~WmtsLayer()
QMap<QString, QString> customParameters() const
WmtsLayerInfo layerInfo() const
TileImageFormat preferredImageFormat() const
void setCustomParameters(const QMap<QString, QString> &customParameters)
WmtsTileMatrixSet tileMatrixSet() const
QString tileMatrixSetId() const
QString wmtsLayerId() 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

Defines an Open Geospatial Consortium (OGC) Web Map Tile Service (WMTS) layer.

An instance of this class allows you to display data from a WMTS service by using pre-generated tiles. A WmtsLayer uses pre-generated tiles to create a map instead of dynamically generating map images.

WmtsLayer adopts the loadable pattern; many of its properties are initialized asynchronously. See Loadable for more information. The layer is loaded when displayed in a MapView or a SceneView; if using the layer without a MapView or a SceneView, call the load method. Use the layer doneLoading signal to determine when the layer is ready, and check the loadStatus before using the layer.

Example: Add a WMTS layer to a map:

QUrl wmtsUrl("http://sampleserver6.arcgisonline.com/arcgis/rest/services/WorldTimeZones/MapServer/WMTS");
QString layerId = "WorldTimeZones";
WmtsLayer* wmtsLayer = new WmtsLayer(wmtsUrl, layerId, parent);

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

  if (wmtsLayer->loadStatus() != LoadStatus::Loaded)
    return;

  // work with WMTS layer here
});

Map* map = new Map(Basemap::imageryWithLabels(parent), parent);
map->operationalLayers()->append(wmtsLayer);

See also WmtsServiceInfo and Loadable.

Member Function Documentation

WmtsLayer::WmtsLayer(const QUrl &url, const QString &wmtsLayerId, QObject *parent = nullptr)

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

WmtsLayer::WmtsLayer(const QUrl &url, const QString &wmtsLayerId, Credential *credential, QObject *parent = nullptr)

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

WmtsLayer::WmtsLayer(const QUrl &url, const QString &wmtsLayerId, TileImageFormat preferredImageFormat, QObject *parent = nullptr)

Constructor that accepts a URL, WTMS layer ID, and preferred image format.

WmtsLayer::WmtsLayer(const QUrl &url, const QString &wmtsLayerId, TileImageFormat preferredImageFormat, Credential *credential, QObject *parent = nullptr)

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

WmtsLayer::WmtsLayer(const QUrl &url, const QString &wmtsLayerId, const QString &tileMatrixSetId, QObject *parent = nullptr)

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

WmtsLayer::WmtsLayer(const QUrl &url, const QString &wmtsLayerId, const QString &tileMatrixSetId, Credential *credential, QObject *parent = nullptr)

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

WmtsLayer::WmtsLayer(const QUrl &url, const QString &wmtsLayerId, const QString &tileMatrixSetId, TileImageFormat preferredImageFormat, QObject *parent = nullptr)

Constructor that accepts a URL (url), wmtsLayerId, tileMatrixSetId, preferredImageFormat and an optional parent.

WmtsLayer::WmtsLayer(const QUrl &url, const QString &wmtsLayerId, const QString &tileMatrixSetId, TileImageFormat preferredImageFormat, Credential *credential, QObject *parent = nullptr)

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

WmtsLayer::WmtsLayer(const WmtsLayerInfo &layerInfo, QObject *parent = nullptr)

Constructor that accepts a layerInfo and an optional parent.

WmtsLayer::WmtsLayer(const WmtsLayerInfo &layerInfo, TileImageFormat preferredImageFormat, QObject *parent = nullptr)

Constructor that accepts a layerInfo, preferredImageFormat and an optional parent.

WmtsLayer::WmtsLayer(const WmtsLayerInfo &layerInfo, const WmtsTileMatrixSet &tileMatrixSet, QObject *parent = nullptr)

Constructor that accepts a layerInfo, tileMatrixSet and an optional parent.

WmtsLayer::WmtsLayer(const WmtsLayerInfo &layerInfo, const WmtsTileMatrixSet &tileMatrixSet, TileImageFormat preferredImageFormat, QObject *parent = nullptr)

Constructor that accepts a layerInfo, tileMatrixSet, preferredImageFormat and an optional parent.

WmtsLayer::~WmtsLayer()

Destructor.

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

Reimplemented from RemoteResource::credential().

Returns the Credential to be used by the network resource in the event of an authentication challenge.

The default credential is a nullptr.

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

Returns custom parameters to append to GetTile requests.

This function was introduced in Esri::ArcGISRuntime 100.6.

See also setCustomParameters.

WmtsLayerInfo WmtsLayer::layerInfo() const

Returns the layer info.

TileImageFormat WmtsLayer::preferredImageFormat() const

Returns the preferred image format.

[virtual] RequestConfiguration WmtsLayer::requestConfiguration() const

Reimplemented from RemoteResource::requestConfiguration().

Returns the RequestConfiguration in use by this layer.

See also setRequestConfiguration().

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

Sets customParameters to append to 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.

This function was introduced in Esri::ArcGISRuntime 100.6.

See also customParameters().

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

Reimplemented from RemoteResource::setRequestConfiguration().

Sets requestConfiguration used for network requests sent by this layer.

See also requestConfiguration().

WmtsTileMatrixSet WmtsLayer::tileMatrixSet() const

Returns the tile matrix set.

QString WmtsLayer::tileMatrixSetId() const

Returns the ID of the tile matrix set used for this layer.

[virtual] QUrl WmtsLayer::url() const

Reimplemented from RemoteResource::url().

Returns the URL of the WMTS layer.

QString WmtsLayer::wmtsLayerId() const

Returns the layer ID that was used to construct this layer.


Feedback on this topic?