Class WmtsSource

Inheritance Relationships

Base Type

Class Documentation

class WmtsSource : public tile_map::TileSource

Public Functions

explicit WmtsSource(const QString &name, const QString &base_url, bool is_custom, int32_t max_zoom)

Creates a new tile source from a set of known parameters.

Parameters:
  • name[in] A user-friendly display name

  • base_url[in] The base HTTP URL of the data source; e. g.: “http://tile.stamen.com/terrain/”

  • is_custom[in] If this is a custom (i. e. not one of the default) tile source; custom sources are saved and loaded from our settings

  • max_zoom[in] The maximum zoom level

virtual size_t GenerateTileHash(int32_t level, int64_t x, int64_t y)

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)

Given a zoom level and x and y coordinates appropriate for the tile source’s projection, this will generate a URL that points to an image tile for that location.

This expects the URL to have three strings in it, “{level}”, “{x}”, and “{y}”, which will be replaced with the passed values. See tile_map_plugin.cpp for example URLs.

Parameters:
  • level[in] The zoom level

  • x[in] The X coordinate of the tile

  • y[in] The Y coordinate of the tile

Returns:

A URL that references that tile

virtual QString GetType() const

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

Returns:

Public Static Attributes

static const QString WMTS_TYPE