#include <bing_source.h>
Definition at line 47 of file bing_source.h.
tile_map::BingSource::BingSource |
( |
const QString & |
name | ) |
|
|
explicit |
Initializes a Bing map source with a given name.
Note that currently, only a single, hard-coded Bing map source is supported. There's only one Bing Maps, after all. In the future, though, it would probably make sense to extend its functionality to allow pulling different tile sets from Bing.
- Parameters
-
name | The name the source will appear as in the combo box. |
Definition at line 49 of file bing_source.cpp.
QString tile_map::BingSource::GenerateQuadKey |
( |
int32_t |
level, |
|
|
int64_t |
x, |
|
|
int64_t |
y |
|
) |
| const |
|
protected |
Bing Maps identifies tiles using a quadkey that is generated from the zoom level and x and y coordinates. Details on how the quadkey is generated can be found here: https://msdn.microsoft.com/en-us/library/bb259689.aspx
- Parameters
-
level | The zoom level |
x | The X coordinate |
y | The Y coordinate |
- Returns
- The quadkey that represents the tile at the requested location
Definition at line 106 of file bing_source.cpp.
size_t tile_map::BingSource::GenerateTileHash |
( |
int32_t |
level, |
|
|
int64_t |
x, |
|
|
int64_t |
y |
|
) |
| |
|
virtual |
Generates a unique hash that identifies the tile as the given coordinates.
Note that Bing Maps tiles could potentially be pulled from one of many different servers, depending on the subdomain list given to us after we authenticate with our API Key. That means the exact URL to any given tile should not be used as part of the hash, because there are many valid URLs for a tile.
- Parameters
-
level | The zoom level |
x | The X coordinate |
y | The Y coordinate |
- Returns
- A hash that uniquely identifies this tile
Implements tile_map::TileSource.
Definition at line 63 of file bing_source.cpp.
QString tile_map::BingSource::GenerateTileUrl |
( |
int32_t |
level, |
|
|
int64_t |
x, |
|
|
int64_t |
y |
|
) |
| |
|
virtual |
Generates a URL that will retrieve a tile for the given coordinates.
Since Bing can give us a list of subdomains to pull tiles from, the exact subdomain for a tile is chosen at random every time this function is called. That means you are not guaranteed to get the same URL for a tile every time you call this function.
- Parameters
-
level | The zoom level |
x | The X coordinate |
y | The Y coordinate |
- Returns
- A URL that points to this tile
Implements tile_map::TileSource.
Definition at line 69 of file bing_source.cpp.
QString tile_map::BingSource::GetApiKey |
( |
| ) |
const |
QString tile_map::BingSource::GetType |
( |
| ) |
const |
|
virtual |
void tile_map::BingSource::ReplyFinished |
( |
QNetworkReply * |
reply | ) |
|
|
protectedslot |
void tile_map::BingSource::SetApiKey |
( |
const QString & |
api_key | ) |
|
Bing requires an API key in order to access its tiles. The key provided will determine the URL we use to retrieve map tiles, so setting the API key will also cause this object to make a network request to the Bing Map server to get the appropriate URL.
More information about getting an API key: https://msdn.microsoft.com/en-us/library/ff428642.aspx
- Parameters
-
api_key | A valid Bing Maps key |
Definition at line 91 of file bing_source.cpp.
QString tile_map::BingSource::api_key_ |
|
protected |
const std::string tile_map::BingSource::BING_IMAGE_URL_KEY = "imageUrl" |
|
staticprotected |
const std::string tile_map::BingSource::BING_IMAGE_URL_SUBDOMAIN_KEY = "imageUrlSubdomains" |
|
staticprotected |
const std::string tile_map::BingSource::BING_RESOURCE_KEY = "resources" |
|
staticprotected |
const std::string tile_map::BingSource::BING_RESOURCE_SET_KEY = "resourceSets" |
|
staticprotected |
const std::string tile_map::BingSource::BING_STATUS_CODE_KEY = "statusCode" |
|
staticprotected |
const QString tile_map::BingSource::BING_TYPE = "bing" |
|
static |
boost::hash<std::string> tile_map::BingSource::hash_ |
|
protected |
QNetworkAccessManager tile_map::BingSource::network_manager_ |
|
protected |
boost::random::mt19937 tile_map::BingSource::rng_ |
|
protected |
std::vector<QString> tile_map::BingSource::subdomains_ |
|
protected |
QString tile_map::BingSource::tile_url_ |
|
protected |
The documentation for this class was generated from the following files: