Commit 359e37f9 authored by DonLakeFlyer's avatar DonLakeFlyer

parent 93bc3694
...@@ -155,6 +155,17 @@ QString UrlFactory::getTypeFromId(int id) { ...@@ -155,6 +155,17 @@ QString UrlFactory::getTypeFromId(int id) {
return ""; return "";
} }
MapProvider* UrlFactory::getMapProviderFromId(int id)
{
QString type = getTypeFromId(id);
if (!type.isEmpty()) {
if (_providersTable.find(type) != _providersTable.end()) {
return _providersTable[type];
}
}
return nullptr;
}
// Todo : qHash produce a uint bigger than max(int) // Todo : qHash produce a uint bigger than max(int)
// There is still a low probability for this to // There is still a low probability for this to
// generate similar hash for different types // generate similar hash for different types
......
...@@ -48,6 +48,7 @@ public: ...@@ -48,6 +48,7 @@ public:
int getIdFromType(QString type); int getIdFromType(QString type);
QString getTypeFromId(int id); QString getTypeFromId(int id);
MapProvider* getMapProviderFromId(int id);
QGCTileSet getTileCount(int zoom, double topleftLon, double topleftLat, QGCTileSet getTileCount(int zoom, double topleftLon, double topleftLat,
double bottomRightLon, double bottomRightLat, double bottomRightLon, double bottomRightLat,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment