MapLibre Native Core
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
mbgl::TileServerOptions Class Referencefinal

Holds values for tile server options. More...

#include <tile_server_options.hpp>

Public Member Functions

 TileServerOptions ()
 Constructs a TileServerOptions object with default values. More...
 
 ~TileServerOptions ()
 
 TileServerOptions (TileServerOptions &&options) noexcept
 
TileServerOptionsoperator= (TileServerOptions &&options) noexcept
 
 TileServerOptions (const TileServerOptions &)
 
TileServerOptions clone () const
 
TileServerOptionswithBaseURL (std::string baseURL)
 Sets the API base URL. More...
 
const std::string & baseURL () const
 Gets the previously set (or default) API base URL. More...
 
TileServerOptionswithUriSchemeAlias (std::string alias)
 Sets the scheme alias for the tile server. For example maptiler:// for MapTiler. More...
 
const std::string & uriSchemeAlias () const
 Gets the previously set (or default) tile server URI alias. More...
 
TileServerOptionswithSourceTemplate (std::string sourceTemplate, std::string domainName, std::optional< std::string > versionPrefix)
 Sets the template for sources. More...
 
const std::string & sourceTemplate () const
 Gets the previously set (or default) source template. More...
 
const std::string & sourceDomainName () const
 Gets the previously set (or default) source domain name. More...
 
const std::optional< std::string > & sourceVersionPrefix () const
 Gets the previously set (or default) version prefix. More...
 
TileServerOptionswithStyleTemplate (std::string styleTemplate, std::string domainName, std::optional< std::string > versionPrefix)
 Sets the template for styles. More...
 
const std::string & styleTemplate () const
 Gets the previously set (or default) style template. More...
 
const std::string & styleDomainName () const
 Gets the previously set (or default) style domain name. More...
 
const std::optional< std::string > & styleVersionPrefix () const
 Gets the previously set (or default) version prefix. More...
 
TileServerOptionswithSpritesTemplate (std::string spritesTemplate, std::string domainName, std::optional< std::string > versionPrefix)
 Sets the template for sprites. More...
 
const std::string & spritesTemplate () const
 Gets the previously set (or default) sprites template. More...
 
const std::string & spritesDomainName () const
 Gets the previously set (or default) sprites domain name. More...
 
const std::optional< std::string > & spritesVersionPrefix () const
 Gets the previously set (or default) version prefix. More...
 
TileServerOptionswithGlyphsTemplate (std::string glyphsTemplate, std::string domainName, std::optional< std::string > versionPrefix)
 Sets the template for glyphs. More...
 
const std::string & glyphsTemplate () const
 Gets the previously set (or default) glyphs template. More...
 
const std::string & glyphsDomainName () const
 Gets the previously set (or default) glyphs domain name. More...
 
const std::optional< std::string > & glyphsVersionPrefix () const
 Gets the previously set (or default) version prefix. More...
 
TileServerOptionswithTileTemplate (std::string tileTemplate, std::string domainName, std::optional< std::string > versionPrefix)
 Sets the template for tiles. More...
 
const std::string & tileTemplate () const
 Gets the previously set (or default) tile template. More...
 
const std::string & tileDomainName () const
 Gets the previously set (or default) tile domain name. More...
 
const std::optional< std::string > & tileVersionPrefix () const
 Gets the previously set (or default) version prefix. More...
 
TileServerOptionswithApiKeyParameterName (std::string apiKeyParameterName)
 Sets the access token parameter name. More...
 
const std::string & apiKeyParameterName () const
 Gets the previously set (or default) apiKeyParameterName. More...
 
TileServerOptionssetRequiresApiKey (bool apiKeyRequired)
 
bool requiresApiKey () const
 Whether the tile server requires API key. More...
 
const std::vector< mbgl::util::DefaultStyledefaultStyles () const
 Gets the default styles. More...
 
TileServerOptionswithDefaultStyles (std::vector< mbgl::util::DefaultStyle > styles)
 Sets the collection default styles. More...
 
TileServerOptionswithDefaultStyle (std::string defaultStyle)
 Sets the default style by name. The style name must exists in defaultStyles collection. More...
 
const std::string & defaultStyle () const
 Get the default style name. More...
 

Static Public Member Functions

static TileServerOptions DefaultConfiguration ()
 Get the default configuration. More...
 
static TileServerOptions MapLibreConfiguration ()
 Get the tile server options configured for MapLibre. More...
 
static TileServerOptions MapboxConfiguration ()
 Get the tile server options configured for Mapbox. More...
 
static TileServerOptions MapTilerConfiguration ()
 Get the tile server options configured for MapTiler. More...
 

Detailed Description

Holds values for tile server options.

Definition at line 15 of file tile_server_options.hpp.

Constructor & Destructor Documentation

◆ TileServerOptions() [1/3]

mbgl::TileServerOptions::TileServerOptions ( )
explicit

Constructs a TileServerOptions object with default values.

◆ ~TileServerOptions()

mbgl::TileServerOptions::~TileServerOptions ( )

◆ TileServerOptions() [2/3]

mbgl::TileServerOptions::TileServerOptions ( TileServerOptions &&  options)
noexcept

◆ TileServerOptions() [3/3]

mbgl::TileServerOptions::TileServerOptions ( const TileServerOptions )

Member Function Documentation

◆ apiKeyParameterName()

const std::string& mbgl::TileServerOptions::apiKeyParameterName ( ) const

Gets the previously set (or default) apiKeyParameterName.

Returns
const std::string& apiKeyParameterName.

◆ baseURL()

const std::string& mbgl::TileServerOptions::baseURL ( ) const

Gets the previously set (or default) API base URL.

Returns
const std::string& API base URL.

◆ clone()

TileServerOptions mbgl::TileServerOptions::clone ( ) const

◆ DefaultConfiguration()

static TileServerOptions mbgl::TileServerOptions::DefaultConfiguration ( )
static

Get the default configuration.

◆ defaultStyle()

const std::string& mbgl::TileServerOptions::defaultStyle ( ) const

Get the default style name.

◆ defaultStyles()

const std::vector<mbgl::util::DefaultStyle> mbgl::TileServerOptions::defaultStyles ( ) const

Gets the default styles.

◆ glyphsDomainName()

const std::string& mbgl::TileServerOptions::glyphsDomainName ( ) const

Gets the previously set (or default) glyphs domain name.

Returns
const std::string& domain name.

◆ glyphsTemplate()

const std::string& mbgl::TileServerOptions::glyphsTemplate ( ) const

Gets the previously set (or default) glyphs template.

Returns
const std::string& glyphs template.

◆ glyphsVersionPrefix()

const std::optional<std::string>& mbgl::TileServerOptions::glyphsVersionPrefix ( ) const

Gets the previously set (or default) version prefix.

Returns
const optional<std::string>& version prefix.

◆ MapboxConfiguration()

static TileServerOptions mbgl::TileServerOptions::MapboxConfiguration ( )
static

Get the tile server options configured for Mapbox.

◆ MapLibreConfiguration()

static TileServerOptions mbgl::TileServerOptions::MapLibreConfiguration ( )
static

Get the tile server options configured for MapLibre.

◆ MapTilerConfiguration()

static TileServerOptions mbgl::TileServerOptions::MapTilerConfiguration ( )
static

Get the tile server options configured for MapTiler.

◆ operator=()

TileServerOptions& mbgl::TileServerOptions::operator= ( TileServerOptions &&  options)
noexcept

◆ requiresApiKey()

bool mbgl::TileServerOptions::requiresApiKey ( ) const

Whether the tile server requires API key.

Returns
const bool true if API key is required

◆ setRequiresApiKey()

TileServerOptions& mbgl::TileServerOptions::setRequiresApiKey ( bool  apiKeyRequired)

◆ sourceDomainName()

const std::string& mbgl::TileServerOptions::sourceDomainName ( ) const

Gets the previously set (or default) source domain name.

Returns
const std::string& source domain name.

◆ sourceTemplate()

const std::string& mbgl::TileServerOptions::sourceTemplate ( ) const

Gets the previously set (or default) source template.

Returns
const std::string& source template.

◆ sourceVersionPrefix()

const std::optional<std::string>& mbgl::TileServerOptions::sourceVersionPrefix ( ) const

Gets the previously set (or default) version prefix.

Returns
const optional<std::string>& version prefix.

◆ spritesDomainName()

const std::string& mbgl::TileServerOptions::spritesDomainName ( ) const

Gets the previously set (or default) sprites domain name.

Returns
const std::string& domain name.

◆ spritesTemplate()

const std::string& mbgl::TileServerOptions::spritesTemplate ( ) const

Gets the previously set (or default) sprites template.

Returns
const std::string& sprites template.

◆ spritesVersionPrefix()

const std::optional<std::string>& mbgl::TileServerOptions::spritesVersionPrefix ( ) const

Gets the previously set (or default) version prefix.

Returns
const optional<std::string>& version prefix.

◆ styleDomainName()

const std::string& mbgl::TileServerOptions::styleDomainName ( ) const

Gets the previously set (or default) style domain name.

Returns
const std::string& domain name.

◆ styleTemplate()

const std::string& mbgl::TileServerOptions::styleTemplate ( ) const

Gets the previously set (or default) style template.

Returns
const std::string& style template.

◆ styleVersionPrefix()

const std::optional<std::string>& mbgl::TileServerOptions::styleVersionPrefix ( ) const

Gets the previously set (or default) version prefix.

Returns
const optional<std::string>& version prefix.

◆ tileDomainName()

const std::string& mbgl::TileServerOptions::tileDomainName ( ) const

Gets the previously set (or default) tile domain name.

Returns
const std::string& domain name.

◆ tileTemplate()

const std::string& mbgl::TileServerOptions::tileTemplate ( ) const

Gets the previously set (or default) tile template.

Returns
const std::string& tile template.

◆ tileVersionPrefix()

const std::optional<std::string>& mbgl::TileServerOptions::tileVersionPrefix ( ) const

Gets the previously set (or default) version prefix.

Returns
const optional<std::string>& version prefix.

◆ uriSchemeAlias()

const std::string& mbgl::TileServerOptions::uriSchemeAlias ( ) const

Gets the previously set (or default) tile server URI alias.

Returns
const std::string& scheme alias.

◆ withApiKeyParameterName()

TileServerOptions& mbgl::TileServerOptions::withApiKeyParameterName ( std::string  apiKeyParameterName)

Sets the access token parameter name.

Parameters
apiKeyParameterNameThe parameter name.
Returns
TileServerOptions for chaining options together.

◆ withBaseURL()

TileServerOptions& mbgl::TileServerOptions::withBaseURL ( std::string  baseURL)

Sets the API base URL.

Parameters
baseURLAPI base URL.
Returns
TileServerOptions for chaining options together.

◆ withDefaultStyle()

TileServerOptions& mbgl::TileServerOptions::withDefaultStyle ( std::string  defaultStyle)

Sets the default style by name. The style name must exists in defaultStyles collection.

Parameters
defaultStyleThe style name
Returns
TileServerOptions for chaining options together.

◆ withDefaultStyles()

TileServerOptions& mbgl::TileServerOptions::withDefaultStyles ( std::vector< mbgl::util::DefaultStyle styles)

Sets the collection default styles.

Parameters
stylesThe style set.
Returns
TileServerOptions for chaining options together.

◆ withGlyphsTemplate()

TileServerOptions& mbgl::TileServerOptions::withGlyphsTemplate ( std::string  glyphsTemplate,
std::string  domainName,
std::optional< std::string >  versionPrefix 
)

Sets the template for glyphs.

Parameters
glyphsTemplateThe glyphs template.
domainNameIf set, the URL domain must contain the specified string to be matched as canonical glyphs URL .
Returns
TileServerOptions for chaining options together.

◆ withSourceTemplate()

TileServerOptions& mbgl::TileServerOptions::withSourceTemplate ( std::string  sourceTemplate,
std::string  domainName,
std::optional< std::string >  versionPrefix 
)

Sets the template for sources.

Parameters
sourceTemplateThe source template.
domainNameThe domain name.
Returns
TileServerOptions for chaining options together.

◆ withSpritesTemplate()

TileServerOptions& mbgl::TileServerOptions::withSpritesTemplate ( std::string  spritesTemplate,
std::string  domainName,
std::optional< std::string >  versionPrefix 
)

Sets the template for sprites.

Parameters
domainNameIf set, the URL domain must contain the specified string to be matched as canonical sprite URL .
spritesTemplateThe sprites template.
Returns
TileServerOptions for chaining options together.

◆ withStyleTemplate()

TileServerOptions& mbgl::TileServerOptions::withStyleTemplate ( std::string  styleTemplate,
std::string  domainName,
std::optional< std::string >  versionPrefix 
)

Sets the template for styles.

Parameters
styleTemplateThe style template.
domainNameIf set, the URL domain must contain the specified string to be matched as canonical style URL .
Returns
TileServerOptions for chaining options together.

◆ withTileTemplate()

TileServerOptions& mbgl::TileServerOptions::withTileTemplate ( std::string  tileTemplate,
std::string  domainName,
std::optional< std::string >  versionPrefix 
)

Sets the template for tiles.

Parameters
tileTemplateThe tile template.
domainNameIf set, the URL domain must contain the specified string to be matched as canonical tile URL .
Returns
TileServerOptions for chaining options together.

◆ withUriSchemeAlias()

TileServerOptions& mbgl::TileServerOptions::withUriSchemeAlias ( std::string  alias)

Sets the scheme alias for the tile server. For example maptiler:// for MapTiler.

Parameters
aliasThe URI alias.
Returns
TileServerOptions for chaining options together.

The documentation for this class was generated from the following file: