Class TileSource

Inheritance Relationships

Base Type

  • public QObject

Derived Types

Class Documentation

class TileSource : public QObject

Represents a network source for map tiles; contains information about how to connect to the source and how to retrieve tiles from it.

Implementations of this should be specific to a type of map server such as WMS, WMTS, or TMS, and implement the appropriate methods for retrieiving tiles from those servers.

Subclassed by tile_map::BingSource, tile_map::WmtsSource

Public Functions

~TileSource() override = default
virtual const QString &GetBaseUrl() const
virtual void SetBaseUrl(const QString &base_url)
virtual bool IsCustom() const
inline virtual bool IsReady() const
virtual void SetCustom(bool is_custom)
virtual int32_t GetMaxZoom() const
virtual void SetMaxZoom(int32_t max_zoom)
virtual int32_t GetMinZoom() const
virtual void SetMinZoom(int32_t min_zoom)
virtual const QString &GetName() const
virtual void SetName(const QString &name)
virtual size_t GenerateTileHash(int32_t level, int64_t x, int64_t y) = 0

Generates a hash that uniquely identifies the tile from this source at the specified level and coordinates.

Parameters:
  • level – The zoom level

  • x – The X coordinate

  • y – The Y coordinate

Returns:

A hash identifying the tile

virtual QString GenerateTileUrl(int32_t level, int64_t x, int64_t y) = 0

Generates an HTTP or HTTPS URL that refers to a map tile from this source at the given level and x and y coordinates.

Parameters:
  • level – The zoom level

  • x – The x coordinate

  • y – The y coordinate

Returns:

A URL referring to the map tile

virtual QString GetType() const = 0

Returns a string identifying the type of map source (“wmts”, “bing”, etc.)

Returns:

Signals

void ErrorMessage(const std::string &error_msg) const
void InfoMessage(const std::string &info_msg) const

Protected Functions

inline TileSource()

Protected Attributes

QString base_url_
bool is_custom_
bool is_ready_
int32_t max_zoom_
int32_t min_zoom_
QString name_