WmtsService Class

  • WmtsService
  • class Esri::ArcGISRuntime::WmtsService

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

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

    Public Functions

    WmtsService(const QUrl &url, QObject *parent = nullptr)
    WmtsService(const QUrl &url, Esri::ArcGISRuntime::Credential *credential, 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(const Esri::ArcGISRuntime::Error &loadError)
    void loadStatusChanged(Esri::ArcGISRuntime::LoadStatus loadStatus)

    Detailed Description

    The OGC WMTS standard is an international specification for serving digital maps over the web using cached image tiles. The WMTS service may be hosted in ArcGIS Online, ArcGIS Enterprise, or on a third party server. You can construct a WmtsService using the URL for a WMTS service. Once loaded, you can browse its metadata using serviceInfo and access its layers using the WmtsServiceInfo::layerInfos collection.

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

    WMTS version 1.0.0 is supported.

    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

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

    Creates a WmtsService with the specified URL to the WMTS service.

    • url - URL of the OGC WMTS service.
    • parent - The optional parent QObject.

    For some WMTS services it may be necessary to provide a direct URL to the getCapabilities resource, by appending either /1.0.0/WMTSCapabilities.xml or ?service=wmts&request=getCapabilities&version=1.0.0 to the root WMTS URL.

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

    [override virtual] WmtsService::~WmtsService()

    Destructor.

    [override virtual] void WmtsService::cancelLoad()

    Reimplements: Loadable::cancelLoad().

    Cancels loading metadata for the object.

    Cancels loading the metadata if the object is loading.

    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.

    [since Esri::ArcGISRuntime 100.6] QMap<QString, QString> WmtsService::customParameters() const

    Returns these parameters are appended to GetCapabilities, and GetTile.

    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.

    If used with WmtsLayer::customParameters property, duplicate parameters in customParameters will not take precedence.

    This function was introduced in Esri::ArcGISRuntime 100.6.

    See also setCustomParameters().

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

    [override virtual] void WmtsService::load()

    Reimplements: Loadable::load().

    Loads the metadata for the object asynchronously.

    Loads the metadata if the object is not loaded.

    See Loadable.

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

    Reimplements: Loadable::loadError() const.

    Returns the load error.

    See Loadable.

    See also Error.

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

    Reimplements: Loadable::loadStatus() const.

    Returns the load status.

    See Loadable.

    See also LoadStatus.

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

    Signal emitted when the load status changes for this object.

    See also 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().

    Loads or retries loading metadata for the object asynchronously.

    Will retry loading the metadata if the object is failed to load. Will load the object if it is not loaded. Will not retry to load the object if the object is loaded.

    See Loadable.

    Esri::ArcGISRuntime::WmtsServiceInfo WmtsService::serviceInfo() const

    Returns the information for browsing and accessing the WmtsService content.

    [since Esri::ArcGISRuntime 100.6] void WmtsService::setCustomParameters(const QMap<QString, QString> &customParameters)

    Sets the customParameters to customParameters.

    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 WMTS service's URL.

    Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.