Files
MapLibreParticleLab/src/mbgl/util/mapbox.hpp
Konstantin Käfer a84cf62424 [core] include api.mapbox.com in canonicalization
and move the canonicalization to mapbox.cpp since it's not specific to the SQLiteCache
2015-09-28 15:06:41 +02:00

28 lines
1015 B
C++

#ifndef MBGL_UTIL_MAPBOX
#define MBGL_UTIL_MAPBOX
#include <string>
#include <mbgl/style/types.hpp>
namespace mbgl {
namespace util {
namespace mapbox {
std::string normalizeSourceURL(const std::string& url, const std::string& accessToken);
std::string normalizeStyleURL(const std::string& url, const std::string& accessToken);
std::string normalizeSpriteURL(const std::string& url, const std::string& accessToken);
std::string normalizeGlyphsURL(const std::string& url, const std::string& accessToken);
std::string normalizeTileURL(const std::string& url, const std::string& sourceURL, SourceType sourceType);
// Canonicalizes Mapbox URLs by removing [a-d] subdomain prefixes, access tokens, and protocol.
// Note that this is close, but not exactly the reverse operation as above, as this retains certain
// information, such as the API version. It is used to cache resources retrieved from the URL, that
// sometimes have multiple valid URLs.
std::string canonicalURL(const std::string &url);
}
}
}
#endif