WmsLayer Class
Displays 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
void | fullTimeExtentChanged() |
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. WmsLayer 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 with ArcGIS Server.
Functional characteristics
A WMS service can contain multiple layers in a hierarchy. WmsLayer 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. A WmsLayer 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.
WmsLayer supports identify and time, but not selection or query. Note that due to the nature of WMS, it is not possible to retrieve feature geometry from WMS identify results. WmsLayer supports custom parameters, which can be specified for the service or an individual layer.
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.
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.
Use this method to create a WMS layer. To specify a preferred WMS version, set the 'VERSION' parameter in the 'GetCapabilities' URL for the service.
See also WmsLayer.
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 from the specified set of WmsLayerInfo objects.
- layerInfos - A QList of WmsLayerInfo objects representing the visible WMS layers to include.
- parent - The optional parent QObject.
Use this method to create a WmsLayer when you have a set of WmsLayerInfo objects to include in the layer.
[explicit]
WmsLayer::WmsLayer (Esri::ArcGISRuntime::Item *item, QObject *parent = nullptr)
Creates a WMS layer object from an item.
- item - A Item (only PortalItem are supported).
- parent - The optional parent QObject.
See also Layer::item.
[override virtual]
WmsLayer::~WmsLayer ()
Destructor.
[override virtual]
Esri::ArcGISRuntime::Credential *WmsLayer::credential() const
Reimplements: RemoteResource::credential() const.
Returns the Credential to be used by the network resource in the event of an authentication challenge.
The default credential is a nullptr
.
[since Esri::ArcGISRuntime 100.3]
QMap<QString, QString> WmsLayer::customParameters () const
Returns these parameters are appended to GetMap and GetFeatureInfo requests.
If a parameter with the same name is defined in the service's custom parameters, then layer-specific values take precedence over service-wide values. WmsLayer CustomParameters property will take precedence over CustomParameters property on WmsService.
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.
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 a flag indicating whether the object supports filtering its contents by time values with the extent set on the owning GeoView.
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 a flag indicating whether the object must use the time extent defined on the owning GeoView to filter its data.
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 the service does not support the 'preferred' image format, images will be returned in a supported format; An error will not be generated.
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 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.
[override virtual, since Esri::ArcGISRuntime 100.3]
Esri::ArcGISRuntime::TimeValue WmsLayer::timeOffset () const
Reimplements: TimeAware::timeOffset() const.
Returns the time offset applied to this object.
The offset is subtracted from the time extent set on the owning GeoView. This allows for data from different periods of time to be compared.
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 exception will occur.
See also WmsLayer.
Esri::ArcGISRuntime::WmsVersion WmsLayer::version() const
Returns the WMS version of the WmsLayer.
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.