LuciadCPillar 2026.0.04
Loading...
Searching...
No Matches
luciad::WmsDataSource::Builder Class Referencefinal

A builder to create WmsDataSource instances. More...

#include <luciad/formats/wms/WmsDataSource.h>

Public Member Functions

 Builder (Builder &&other) noexcept
 Move constructor.
 Builder (const Builder &other)
 Copy constructor.
 ~Builder ()
BuilderaddLayer (std::string layerName)
 Adds a WMS layer to load.
BuilderaddLayer (std::string layerName, std::string layerStyleName)
 Adds a WMS layer to load.
std::shared_ptr< WmsDataSourcebuild ()
 Build the WMS data source.
Builderformat (std::string format)
 Sets the image format for GetMap requests.
Builderoperator= (Builder other) noexcept
BuilderstyledLayerDescriptor (std::string styledLayerDescriptor)
 Sets the Styled Layer Descriptor to pass when making a request.
BuilderstyledLayerDescriptorUrl (std::string styledLayerDescriptorUrl)
 Sets an URL pointing to a valid Styled Layer Descriptor which will be used by the server.
Buildertransparent (bool transparent)
 Sets if the requested image should have a transparent background, provided that the image format supports transparency.
Builderurl (std::string url)
 Sets the base URL of the WMS data source.

Detailed Description

A builder to create WmsDataSource instances.

This builder requires at a minimum a URL and one or more layers.

Since
2020.2

Constructor & Destructor Documentation

◆ Builder() [1/2]

luciad::WmsDataSource::Builder::Builder ( const Builder & other)

Copy constructor.

Parameters
otherthe builder to copy.

◆ Builder() [2/2]

luciad::WmsDataSource::Builder::Builder ( Builder && other)
noexcept

Move constructor.

Parameters
otherthe builder to move from.

◆ ~Builder()

luciad::WmsDataSource::Builder::~Builder ( )

Member Function Documentation

◆ addLayer() [1/2]

Builder & luciad::WmsDataSource::Builder::addLayer ( std::string layerName)

Adds a WMS layer to load.

The layer is added on top of other added WMS layers.

At least one of the addLayer methods must be called.

Parameters
layerNameThe name of the WMS layer.
Returns
this builder.

◆ addLayer() [2/2]

Builder & luciad::WmsDataSource::Builder::addLayer ( std::string layerName,
std::string layerStyleName )

Adds a WMS layer to load.

The layer is added on top of other added WMS layers.

At least one of the addLayer methods must be called.

Parameters
layerNameThe name of the WMS layer.
layerStyleNameThe WMS layer style name. This refers to a published named layer style of the WMS capabilities.
Returns
this builder.

◆ build()

std::shared_ptr< WmsDataSource > luciad::WmsDataSource::Builder::build ( )

Build the WMS data source.

After calling this function, this builder should no longer be used.

Returns
the WMS data source.
Exceptions
luciad::LogicExceptionIf not all mandatory parameters are set.

◆ format()

Builder & luciad::WmsDataSource::Builder::format ( std::string format)

Sets the image format for GetMap requests.

When this method is not called the image format is determined by the WMS model decoder.

Parameters
formatthe image format for GetMap requests.
Returns
this builder.

◆ operator=()

Builder & luciad::WmsDataSource::Builder::operator= ( Builder other)
noexcept

◆ styledLayerDescriptor()

Builder & luciad::WmsDataSource::Builder::styledLayerDescriptor ( std::string styledLayerDescriptor)

Sets the Styled Layer Descriptor to pass when making a request.

This corresponds to the SLD_BODY request parameter in the GetMap request. The SLD must not be URL encoded. The SLD can be set using either one of the following method :

Note that when these methods are called multiple times, only the last method call is taken into account.

You can find more information within the article on how to use Styled Layer Descriptor.

See also
WmsDataSource::Builder::styledLayerDescriptorUrl
Parameters
styledLayerDescriptorthe Styled Layer Descriptor.
Returns
this builder.

◆ styledLayerDescriptorUrl()

Builder & luciad::WmsDataSource::Builder::styledLayerDescriptorUrl ( std::string styledLayerDescriptorUrl)

Sets an URL pointing to a valid Styled Layer Descriptor which will be used by the server.

This corresponds to the SLD request parameter in the GetMap request. The SLD can be set using either one of the following method :

Note that when these methods are called multiple times, only the last method call is taken into account.

You can find more information within the article on how to use Styled Layer Descriptor.

See also
WmsDataSource::Builder::styledLayerDescriptor
Parameters
styledLayerDescriptorUrlthe URL pointing to a Styled Layer Descriptor.
Returns
this builder.

◆ transparent()

Builder & luciad::WmsDataSource::Builder::transparent ( bool transparent)

Sets if the requested image should have a transparent background, provided that the image format supports transparency.

When this method is not called the default value is true.

Parameters
transparentif the requested image should have a transparent background, provided that the image format supports transparency.
Returns
this builder.

◆ url()

Builder & luciad::WmsDataSource::Builder::url ( std::string url)

Sets the base URL of the WMS data source.

Calling this function is mandatory.

Parameters
urlthe base URL of the WMS data source. Calling this function is mandatory.
Returns
this builder.