MapLibre Native Core
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
tile_server_options.hpp
Go to the documentation of this file.
1 #pragma once
2 
4 
5 #include <memory>
6 #include <optional>
7 #include <string>
8 #include <vector>
9 
10 namespace mbgl {
11 
15  class TileServerOptions final {
16  public:
20  explicit TileServerOptions();
22 
23  // movable
24  TileServerOptions(TileServerOptions&& options) noexcept;
26 
27  // copyable
29 
30 
32 
40 
46  const std::string& baseURL() const;
47 
55 
61  const std::string& uriSchemeAlias() const;
62 
70  TileServerOptions& withSourceTemplate(std::string sourceTemplate, std::string domainName, std::optional<std::string> versionPrefix);
71 
77  const std::string& sourceTemplate() const;
78 
84  const std::string& sourceDomainName() const;
85 
91  const std::optional<std::string>& sourceVersionPrefix() const;
92 
101  TileServerOptions& withStyleTemplate(std::string styleTemplate, std::string domainName, std::optional<std::string> versionPrefix);
102 
108  const std::string& styleTemplate() const;
109 
115  const std::string& styleDomainName() const;
116 
122  const std::optional<std::string>& styleVersionPrefix() const;
123 
131  TileServerOptions& withSpritesTemplate(std::string spritesTemplate, std::string domainName, std::optional<std::string> versionPrefix);
132 
138  const std::string& spritesTemplate() const;
139 
146 
152  const std::optional<std::string>& spritesVersionPrefix() const;
153 
162  TileServerOptions& withGlyphsTemplate(std::string glyphsTemplate, std::string domainName, std::optional<std::string> versionPrefix);
163 
169  const std::string& glyphsTemplate() const;
170 
177 
183  const std::optional<std::string>& glyphsVersionPrefix() const;
184 
193  TileServerOptions& withTileTemplate(std::string tileTemplate, std::string domainName, std::optional<std::string> versionPrefix);
194 
200  const std::string& tileTemplate() const;
201 
207  const std::string& tileDomainName() const;
208 
214  const std::optional<std::string>& tileVersionPrefix() const;
215 
223 
230 
231  TileServerOptions& setRequiresApiKey(bool apiKeyRequired);
232 
238  bool requiresApiKey() const;
242  const std::vector<mbgl::util::DefaultStyle> defaultStyles() const;
243 
250  TileServerOptions& withDefaultStyles(std::vector<mbgl::util::DefaultStyle> styles);
251 
259 
263  const std::string& defaultStyle() const;
264 
269 
274 
279 
284 
285  private:
286  class Impl;
287  std::unique_ptr<Impl> impl_;
288  };
289 
290 } // namespace mbgl
Holds values for tile server options.
const std::string & glyphsTemplate() const
Gets the previously set (or default) glyphs template.
TileServerOptions & withSpritesTemplate(std::string spritesTemplate, std::string domainName, std::optional< std::string > versionPrefix)
Sets the template for sprites.
TileServerOptions & withUriSchemeAlias(std::string alias)
Sets the scheme alias for the tile server. For example maptiler:// for MapTiler.
static TileServerOptions MapTilerConfiguration()
Get the tile server options configured for MapTiler.
const std::optional< std::string > & spritesVersionPrefix() const
Gets the previously set (or default) version prefix.
const std::string & styleDomainName() const
Gets the previously set (or default) style domain name.
const std::string & styleTemplate() const
Gets the previously set (or default) style template.
static TileServerOptions DefaultConfiguration()
Get the default configuration.
static TileServerOptions MapboxConfiguration()
Get the tile server options configured for Mapbox.
TileServerOptions & withSourceTemplate(std::string sourceTemplate, std::string domainName, std::optional< std::string > versionPrefix)
Sets the template for sources.
const std::optional< std::string > & tileVersionPrefix() const
Gets the previously set (or default) version prefix.
const std::string & tileDomainName() const
Gets the previously set (or default) tile domain name.
TileServerOptions & operator=(TileServerOptions &&options) noexcept
const std::string & uriSchemeAlias() const
Gets the previously set (or default) tile server URI alias.
TileServerOptions & withDefaultStyle(std::string defaultStyle)
Sets the default style by name. The style name must exists in defaultStyles collection.
TileServerOptions()
Constructs a TileServerOptions object with default values.
const std::string & baseURL() const
Gets the previously set (or default) API base URL.
const std::optional< std::string > & sourceVersionPrefix() const
Gets the previously set (or default) version prefix.
TileServerOptions & withStyleTemplate(std::string styleTemplate, std::string domainName, std::optional< std::string > versionPrefix)
Sets the template for styles.
const std::string & defaultStyle() const
Get the default style name.
TileServerOptions(const TileServerOptions &)
const std::string & spritesTemplate() const
Gets the previously set (or default) sprites template.
const std::string & tileTemplate() const
Gets the previously set (or default) tile template.
TileServerOptions & withBaseURL(std::string baseURL)
Sets the API base URL.
const std::string & spritesDomainName() const
Gets the previously set (or default) sprites domain name.
const std::optional< std::string > & glyphsVersionPrefix() const
Gets the previously set (or default) version prefix.
const std::string & sourceDomainName() const
Gets the previously set (or default) source domain name.
bool requiresApiKey() const
Whether the tile server requires API key.
const std::string & sourceTemplate() const
Gets the previously set (or default) source template.
TileServerOptions clone() const
const std::optional< std::string > & styleVersionPrefix() const
Gets the previously set (or default) version prefix.
static TileServerOptions MapLibreConfiguration()
Get the tile server options configured for MapLibre.
const std::string & glyphsDomainName() const
Gets the previously set (or default) glyphs domain name.
TileServerOptions & setRequiresApiKey(bool apiKeyRequired)
TileServerOptions & withApiKeyParameterName(std::string apiKeyParameterName)
Sets the access token parameter name.
TileServerOptions & withGlyphsTemplate(std::string glyphsTemplate, std::string domainName, std::optional< std::string > versionPrefix)
Sets the template for glyphs.
TileServerOptions & withDefaultStyles(std::vector< mbgl::util::DefaultStyle > styles)
Sets the collection default styles.
const std::vector< mbgl::util::DefaultStyle > defaultStyles() const
Gets the default styles.
TileServerOptions & withTileTemplate(std::string tileTemplate, std::string domainName, std::optional< std::string > versionPrefix)
Sets the template for tiles.
const std::string & apiKeyParameterName() const
Gets the previously set (or default) apiKeyParameterName.
TileServerOptions(TileServerOptions &&options) noexcept
std::unique_ptr< Expression > string(std::unique_ptr< Expression >, std::unique_ptr< Expression > def=nullptr)
Definition: actor.hpp:15