Skip To Content ArcGIS for Developers Sign In Dashboard

WmsLayer Class

(Esri::ArcGISRuntime::WmsLayer)

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

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

Public Functions

WmsLayer(const QUrl &url, const QStringList &layerNames, QObject *parent = nullptr)
WmsLayer(const QUrl &url, const QStringList &layerNames, Credential *credential, QObject *parent = nullptr)
WmsLayer(const QList<WmsLayerInfo> &layerInfos, QObject *parent = nullptr)
WmsLayer(Item *item, QObject *parent = nullptr)
~WmsLayer()
QMap<QString, QString> customParameters() const
QList<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<WmsSublayer *> subLayers() const
WmsVersion version() const

Reimplemented Public Functions

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

Signals

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

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

An instance of this class allows you to display data from a WMS service.

WmsLayer adopts the loadable pattern, and many of its properties are initialized asynchronously. 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 to load it before use. Use the layer doneLoading signal to determine when the layer is ready, and check the loadStatus before using the layer.

See also WmsServiceInfo, WmsLayerInfo, and Loadable.

Member Function Documentation

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

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

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

WmsLayer::WmsLayer(const QUrl &url, const QStringList &layerNames, 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 Runtime supports WMS versions 1.3.0, 1.1.1, and 1.1.0. The latest supported WMS version is set as the default.

WmsLayer::WmsLayer(const QList<WmsLayerInfo> &layerInfos, QObject *parent = nullptr)

Constructor that accepts a list of layerInfos and an optional parent object.

WmsLayer::WmsLayer(Item *item, QObject *parent = nullptr)

Constructs a WmsLayer with the given WMS layer item (item) and an optional parent.

WmsLayer::~WmsLayer()

Destructor.

[virtual] Credential *WmsLayer::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> WmsLayer::customParameters() const

Returns the custom parameters that are applied to WMS requests related to this layer.

This function was introduced in Esri::ArcGISRuntime 100.3.

See also setCustomParameters().

[virtual] TimeExtent WmsLayer::fullTimeExtent() const

Reimplemented from TimeAware::fullTimeExtent().

Returns the full time extent of the layer.

This function was introduced in Esri::ArcGISRuntime 100.3.

[signal] void WmsLayer::fullTimeExtentChanged()

Signal emitted when the fullTimeExtent changes.

This function was introduced in Esri::ArcGISRuntime 100.3.

See also TimeAware.

[virtual] bool WmsLayer::isSupportsTimeFiltering() const

Reimplemented from TimeAware::isSupportsTimeFiltering().

Returns whether the layer supports filtering its contents by time values.

This function was introduced in Esri::ArcGISRuntime 100.3.

[virtual] bool WmsLayer::isTimeFilteringEnabled() const

Reimplemented from TimeAware::isTimeFilteringEnabled().

Returns whether the layer participates in filtering based on the time extent of its GeoView.

This function was introduced in Esri::ArcGISRuntime 100.3.

QList<WmsLayerInfo> WmsLayer::layerInfos() const

Returns a list of WmsLayerInfo objects describing the selected WMS sublayers.

If the WmsLayer was initialized with url and layerNames, then the layerInfos will be empty until the layer has been loaded.

QStringList WmsLayer::layerNames() const

Returns a list of names of visible WMS layers.

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

Returns the preferred image format of this WMS layer.

If a preferred format is not specified prior to loading, then Png32 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().

[virtual] RequestConfiguration WmsLayer::requestConfiguration() const

Reimplemented from RemoteResource::requestConfiguration().

Returns the RequestConfiguration in use by this layer.

See also setRequestConfiguration().

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

Sets the custom parameters that are applied to WMS requests related to this layer to customParameters.

customParameters is a map of strings where the key is the parameter's name and the value is the parameter's value.

When making a WMS request, only parameters required by the service are included by default. Setting custom parameters will allow you to specify any additional parameters, such as API keys or user credentials, to the service. These parameters will be appended to GetMap and GetFeatureInfo requests.

When used together with a WmsService, if a parameter with the same name is defined in the service's custom parameters, then layer-specific values will take precedence over service-wide parameter values.

This function was introduced in Esri::ArcGISRuntime 100.3.

See also customParameters().

void WmsLayer::setPreferredImageFormat(Esri::ArcGISRuntime::MapServiceImageFormat preferredImageFormat)

Sets the preferred image format of this WMS layer to preferredImageFormat.

If a preferred format is not specified prior to loading, then Png32 is used.

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

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

Reimplemented from RemoteResource::setRequestConfiguration().

Sets requestConfiguration used for network requests sent by this layer.

See also requestConfiguration().

[virtual] void WmsLayer::setTimeFilteringEnabled(bool timeFilteringEnabled)

Reimplemented from TimeAware::setTimeFilteringEnabled().

Sets whether the layer uses the time range defined on the GeoView to timeFilteringEnabled.

This function was introduced in Esri::ArcGISRuntime 100.3.

See also isTimeFilteringEnabled().

[virtual] void WmsLayer::setTimeOffset(const TimeValue &timeOffset)

Reimplemented from TimeAware::setTimeOffset().

Sets the time offset of the layer to timeOffset.

The time offset is subtracted from the time extent set on the layer's GeoView. This can be used to overlay data from different periods of time for comparison.

This function was introduced in Esri::ArcGISRuntime 100.3.

See also timeOffset().

QList<WmsSublayer *> WmsLayer::subLayers() const

Returns a list of sublayers for this WMS layer.

[virtual] TimeValue WmsLayer::timeInterval() const

Reimplemented from TimeAware::timeInterval().

Returns a time interval that represents the suggested step size for use when manipulating the time extent.

This information can be used to set the step size for a time slider control.

This function was introduced in Esri::ArcGISRuntime 100.3.

[virtual] TimeValue WmsLayer::timeOffset() const

Reimplemented from TimeAware::timeOffset().

Returns the applied time offset.

This function was introduced in Esri::ArcGISRuntime 100.3.

See also setTimeOffset().

[virtual] QUrl WmsLayer::url() const

Reimplemented from RemoteResource::url().

Returns the URL of the WMS layer.

WmsVersion WmsLayer::version() const

Returns the version of this WMS layer.


Feedback on this topic?