WmsLayer Class

  • WmsLayer
  • class Esri::ArcGISRuntime::WmsLayer

    A layer that can visualize data from a WMS service. More...

    Header: #include <WmsLayer.h>
    Since: Esri::ArcGISRuntime 100.2
    Inherits: Esri::ArcGISRuntime::ImageAdjustmentLayer, Esri::ArcGISRuntime::RemoteResource, and Esri::ArcGISRuntime::TimeAware

    Public Functions

    WmsLayer(const QUrl &url, const QStringList &layerNames, QObject *parent = nullptr)
    WmsLayer(const QUrl &url, const QStringList &layerNames, Esri::ArcGISRuntime::Credential *credential, QObject *parent = nullptr)
    WmsLayer(const QList<Esri::ArcGISRuntime::WmsLayerInfo> &layerInfos, QObject *parent = nullptr)
    WmsLayer(Esri::ArcGISRuntime::Item *item, QObject *parent = nullptr)
    virtual ~WmsLayer() override
    QMap<QString, QString> customParameters() const
    QList<Esri::ArcGISRuntime::WmsLayerInfo> layerInfos() const
    QStringList layerNames() const
    Esri::ArcGISRuntime::MapServiceImageFormat preferredImageFormat() const
    quint64 refreshInterval() const
    void setCustomParameters(const QMap<QString, QString> &customParameters)
    void setPreferredImageFormat(Esri::ArcGISRuntime::MapServiceImageFormat preferredImageFormat)
    void setRefreshInterval(quint64 milliseconds)
    QList<Esri::ArcGISRuntime::WmsSublayer *> sublayers() const
    Esri::ArcGISRuntime::WmsVersion version() const

    Reimplemented Public Functions

    virtual Esri::ArcGISRuntime::Credential *credential() const override
    virtual Esri::ArcGISRuntime::TimeExtent fullTimeExtent() const override
    virtual bool isSupportsTimeFiltering() const override
    virtual bool isTimeFilteringEnabled() const override
    virtual Esri::ArcGISRuntime::RequestConfiguration requestConfiguration() const override
    virtual void setRequestConfiguration(const Esri::ArcGISRuntime::RequestConfiguration &requestConfiguration) override
    virtual void setTimeFilteringEnabled(bool timeFilteringEnabled) override
    virtual void setTimeOffset(const Esri::ArcGISRuntime::TimeValue &timeOffset) override
    virtual Esri::ArcGISRuntime::TimeValue timeInterval() const override
    virtual Esri::ArcGISRuntime::TimeValue timeOffset() const override
    virtual QUrl url() const override

    Signals

    Detailed Description

    The service may be hosted in the cloud on ArcGIS Online, on a third party server, or on-premises with ArcGIS Server.

    Web Map Service (WMS) is an Open Geospatial Consortium (OGC) standard for delivering map images from an online service. WMS layer displays data from a web service that provides maps in the form of server-rendered images. This API supports WMS versions 1.1.0, 1.1.1, and 1.3.0. The service may be hosted in the cloud on ArcGIS Online, on a third party server, or on-premises ArcGIS Server.

    Functional characteristics

    A WMS service can contain multiple layers in a hierarchy. A WMS layer can be constructed directly with a URL to a service and the uniquely identifying name of the desired layer. Alternatively, a WmsService can be used to programmatically explore the available layers and allow the user to choose layers at run time.

    The maps provided by a WMS service use predefined symbology defined by the server. As a result, it is not possible to apply custom renderers or to visualize feature selection. WMS layers can have multiple style options. Your app can choose from the available styles.

    Some layers can be marked as opaque, which means that they cover most of the map area and are good candidates for use as a basemap.

    WMS layers support identify and time. They do not support selection or query. Note that due to the nature of WMS, it is not possible to retrieve feature geometry from WMS identify results. WMS layers support custom parameters, which can be specified for the service or an individual layer.

    Performance characteristics

    WMS servers render map images on demand, which can require more server resources than a similar tiled service. WMS requires a service connection at all times.

    See sample: WMS layer (URL)

    See also Layer, WmsService, and WmsSublayer.

    Member Function Documentation

    WmsLayer::WmsLayer(const QUrl &url, const QStringList &layerNames, QObject *parent = nullptr)

    Creates a WmsLayer with known URL and layer names.

    • url - The URL of a WMS service.
    • layerNames - A QStringList of the visible WMS layer names.
    • parent - The optional parent QObject.

    To specify a preferred WMS version, set the 'VERSION' parameter in the 'GetCapabilities' URL for the service.

    WmsLayer::WmsLayer(const QUrl &url, const QStringList &layerNames, Esri::ArcGISRuntime::Credential *credential, QObject *parent = nullptr)

    Constructor that accepts a URL, a list of layer names, a credential, and an optional parent object.

    • url - The URL of the WMS service - see WmsService::url
    • layerNames - List of WMS layer names to display
    • credential - The Credential used to access this layer
    • parent - The parent object for this WmsLayer (optional)

    ArcGIS Maps SDK supports WMS versions 1.3.0, 1.1.1, and 1.1.0. The latest supported WMS version is set as the default.

    [explicit] WmsLayer::WmsLayer(const QList<Esri::ArcGISRuntime::WmsLayerInfo> &layerInfos, QObject *parent = nullptr)

    Creates a WmsLayer with the specified layers.

    • layerInfos - A QList of WmsLayerInfo objects representing the visible WMS layers to include.
    • parent - The optional parent QObject.

    [explicit] WmsLayer::WmsLayer(Esri::ArcGISRuntime::Item *item, QObject *parent = nullptr)

    Creates a WMS layer from an portal item.

    See also Layer::item.

    [override virtual] WmsLayer::~WmsLayer()

    Destructor.

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

    Reimplements: RemoteResource::credential() const.

    Returns security credentials to access the remote resource. Only applicable if the resource is secured.

    [since Esri::ArcGISRuntime 100.3] QMap<QString, QString> WmsLayer::customParameters() const

    Returns a QMap (aka. dictionary) of custom parameters to be sent with WMS requests issued by this layer.

    These parameters are appended to GetMap and GetFeatureInfo requests. If a parameter with the same name is defined in WmsService::customParameters, then layer-specific values take precedence over service-wide values.

    This function was introduced in Esri::ArcGISRuntime 100.3.

    See also setCustomParameters().

    [override virtual, since Esri::ArcGISRuntime 100.3] Esri::ArcGISRuntime::TimeExtent WmsLayer::fullTimeExtent() const

    Reimplements: TimeAware::fullTimeExtent() const.

    Returns the full time extent of the layer.

    If the layer, such as a ArcGISMapImageLayer, has sublayers with different time extents, fullTimeExtent is a union of its sublayer's time extents.

    This function was introduced in Esri::ArcGISRuntime 100.3.

    [signal, since Esri::ArcGISRuntime 100.3] void WmsLayer::fullTimeExtentChanged()

    Signal emitted when the fullTimeExtent changes.

    This function was introduced in Esri::ArcGISRuntime 100.3.

    See also TimeAware.

    [override virtual, since Esri::ArcGISRuntime 100.3] bool WmsLayer::isSupportsTimeFiltering() const

    Reimplements: TimeAware::isSupportsTimeFiltering() const.

    Returns true if the layer supports filtering data based on its time values, false otherwise.

    This function was introduced in Esri::ArcGISRuntime 100.3.

    [override virtual, since Esri::ArcGISRuntime 100.3] bool WmsLayer::isTimeFilteringEnabled() const

    Reimplements: TimeAware::isTimeFilteringEnabled() const.

    Returns true if the layer filters data based on its GeoView::timeExtent, false otherwise.

    This is only applicable if the layer's isSupportsTimeFiltering value is true. If the GeoView::timeExtent value is nullptr, no time filtering is applied and all content is rendered.

    This function was introduced in Esri::ArcGISRuntime 100.3.

    QList<Esri::ArcGISRuntime::WmsLayerInfo> WmsLayer::layerInfos() const

    Returns the WMS Layer's set of WmsLayerInfo objects.

    WmsLayerInfo objects describe the layers (as provided by the service). Multiple layers from a WmsService may be included in a single WmsLayer.

    QStringList WmsLayer::layerNames() const

    Returns a list of names of visible WMS layers.

    See also WmsLayerInfo.

    Esri::ArcGISRuntime::MapServiceImageFormat WmsLayer::preferredImageFormat() const

    Returns the preferred image format of the WmsLayer.

    If a preferred format is not specified prior to loading, then MapServiceImageFormat::PNG is used.

    See also setPreferredImageFormat().

    quint64 WmsLayer::refreshInterval() const

    Returns the refresh interval used by the layer, in milliseconds.

    Layers request data from the service each time this interval elapses. A value of 0 means to never refresh.

    See also setRefreshInterval().

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

    Reimplements: RemoteResource::requestConfiguration() const.

    Returns the RequestConfiguration in use by this layer.

    See also setRequestConfiguration().

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

    Sets the customParameters to customParameters.

    This function was introduced in Esri::ArcGISRuntime 100.3.

    See also customParameters.

    [since Esri::ArcGISRuntime 100.2] void WmsLayer::setPreferredImageFormat(Esri::ArcGISRuntime::MapServiceImageFormat preferredImageFormat)

    Sets the preferredImageFormat to preferredImageFormat.

    This function was introduced in Esri::ArcGISRuntime 100.2.

    See also preferredImageFormat.

    void WmsLayer::setRefreshInterval(quint64 milliseconds)

    Sets the refresh interval used by the layer to milliseconds.

    Layers request data from the service each time this interval elapses. A value of 0 means to never refresh.

    See also refreshInterval().

    [override virtual] void WmsLayer::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().

    [override virtual, since Esri::ArcGISRuntime 100.3] void WmsLayer::setTimeFilteringEnabled(bool timeFilteringEnabled)

    Reimplements: TimeAware::setTimeFilteringEnabled(bool timeFilteringEnabled).

    Sets the timeFilteringEnabled to timeFilteringEnabled.

    This function was introduced in Esri::ArcGISRuntime 100.3.

    See also isTimeFilteringEnabled.

    [override virtual, since Esri::ArcGISRuntime 100.3] void WmsLayer::setTimeOffset(const Esri::ArcGISRuntime::TimeValue &timeOffset)

    Reimplements: TimeAware::setTimeOffset(const Esri::ArcGISRuntime::TimeValue &timeOffset).

    Sets the timeOffset to timeOffset.

    This function was introduced in Esri::ArcGISRuntime 100.3.

    See also timeOffset.

    [since Esri::ArcGISRuntime 100.14] QList<Esri::ArcGISRuntime::WmsSublayer *> WmsLayer::sublayers() const

    Returns a list of sublayers for this WMS layer.

    This function was introduced in Esri::ArcGISRuntime 100.14.

    [override virtual, since Esri::ArcGISRuntime 100.3] Esri::ArcGISRuntime::TimeValue WmsLayer::timeInterval() const

    Reimplements: TimeAware::timeInterval() const.

    Returns the suggested time slider step size for this time aware layer.

    You can use this information to set the step size for a time slider control. The value is empty if no time interval is suggested. The author of the layer's data typically configures this property if the data has been collected on a regular basis. For example, the daily position of a hurricane.

    This function was introduced in Esri::ArcGISRuntime 100.3.

    [override virtual, since Esri::ArcGISRuntime 100.3] Esri::ArcGISRuntime::TimeValue WmsLayer::timeOffset() const

    Reimplements: TimeAware::timeOffset() const.

    Returns the amount of time by which the temporal values of this layer's data points are offset when displaying it in a GeoView.

    The time offset is subtracted from the time extent set on the layer's GeoView. This is useful if you want to overlay data in multiple layers that lies within different temporal extents. For example, if you want to compare data in one layer for a certain year with data in the same layer from the subsequent year, you can create two layers that reference the same data's service endpoint but set the TimeValue in one of the layers to be one year.

    This function was introduced in Esri::ArcGISRuntime 100.3.

    See also setTimeOffset().

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

    Reimplements: RemoteResource::url() const.

    Returns the URL of the WmsLayer.

    This method can't be called once the layer is loading else ErrorType::CommonIllegalState error will occur.

    See also WmsLayer.

    Esri::ArcGISRuntime::WmsVersion WmsLayer::version() const

    Returns the version of the WMS specification used by this layer.

    This API supports the following WMS versions: 1.3.0, 1.1.1, and 1.1.0. By default this value is the latest supported WMS version.

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