diff options
Diffstat (limited to 'src/mbgl/util')
-rw-r--r-- | src/mbgl/util/mapbox.cpp | 6 | ||||
-rw-r--r-- | src/mbgl/util/mapbox.hpp | 4 | ||||
-rw-r--r-- | src/mbgl/util/tile_cover.cpp | 4 | ||||
-rw-r--r-- | src/mbgl/util/tile_cover.hpp | 2 |
4 files changed, 8 insertions, 8 deletions
diff --git a/src/mbgl/util/mapbox.cpp b/src/mbgl/util/mapbox.cpp index 8cbc85d492..802b527a26 100644 --- a/src/mbgl/util/mapbox.cpp +++ b/src/mbgl/util/mapbox.cpp @@ -114,7 +114,7 @@ std::string normalizeTileURL(const std::string& baseURL, } std::string -canonicalizeTileURL(const std::string& str, const SourceType type, const uint16_t tileSize) { +canonicalizeTileURL(const std::string& str, const style::SourceType type, const uint16_t tileSize) { const char* version = "/v4/"; const size_t versionLen = strlen(version); @@ -133,7 +133,7 @@ canonicalizeTileURL(const std::string& str, const SourceType type, const uint16_ std::string result = "mapbox://tiles/"; result.append(str, path.directory.first + versionLen, path.directory.second - versionLen); result.append(str, path.filename.first, path.filename.second); - if (type == SourceType::Raster) { + if (type == style::SourceType::Raster) { result += tileSize == util::tileSize ? "@2x" : "{ratio}"; } @@ -171,7 +171,7 @@ canonicalizeTileURL(const std::string& str, const SourceType type, const uint16_ return result; } -void canonicalizeTileset(Tileset& tileset, const std::string& sourceURL, SourceType type, uint16_t tileSize) { +void canonicalizeTileset(Tileset& tileset, const std::string& sourceURL, style::SourceType type, uint16_t tileSize) { // TODO: Remove this hack by delivering proper URLs in the TileJSON to begin with. if (isMapboxURL(sourceURL)) { for (auto& url : tileset.tiles) { diff --git a/src/mbgl/util/mapbox.hpp b/src/mbgl/util/mapbox.hpp index f3dfdd0b01..aa128f2667 100644 --- a/src/mbgl/util/mapbox.hpp +++ b/src/mbgl/util/mapbox.hpp @@ -19,10 +19,10 @@ std::string normalizeGlyphsURL(const std::string& baseURL, const std::string& ur std::string normalizeTileURL(const std::string& baseURL, const std::string& url, const std::string& accessToken); // Return a "mapbox://tiles/..." URL (suitable for normalizeTileURL) for the given Mapbox tile URL. -std::string canonicalizeTileURL(const std::string& url, SourceType, uint16_t tileSize); +std::string canonicalizeTileURL(const std::string& url, style::SourceType, uint16_t tileSize); // Replace URL templates with "mapbox://tiles/..." URLs (suitable for normalizeTileURL). -void canonicalizeTileset(Tileset&, const std::string& url, SourceType, uint16_t tileSize); +void canonicalizeTileset(Tileset&, const std::string& url, style::SourceType, uint16_t tileSize); extern const uint64_t DEFAULT_OFFLINE_TILE_COUNT_LIMIT; diff --git a/src/mbgl/util/tile_cover.cpp b/src/mbgl/util/tile_cover.cpp index a5a1b1d70c..c81becb986 100644 --- a/src/mbgl/util/tile_cover.cpp +++ b/src/mbgl/util/tile_cover.cpp @@ -126,9 +126,9 @@ std::vector<UnwrappedTileID> tileCover(const Point<double>& tl, } // namespace -int32_t coveringZoomLevel(double zoom, SourceType type, uint16_t size) { +int32_t coveringZoomLevel(double zoom, style::SourceType type, uint16_t size) { zoom += std::log(util::tileSize / size) / std::log(2); - if (type == SourceType::Raster || type == SourceType::Video) { + if (type == style::SourceType::Raster || type == style::SourceType::Video) { return ::round(zoom); } else { return std::floor(zoom); diff --git a/src/mbgl/util/tile_cover.hpp b/src/mbgl/util/tile_cover.hpp index 3c7a4ee44a..b2098b59b8 100644 --- a/src/mbgl/util/tile_cover.hpp +++ b/src/mbgl/util/tile_cover.hpp @@ -13,7 +13,7 @@ class LatLngBounds; namespace util { -int32_t coveringZoomLevel(double z, SourceType type, uint16_t tileSize); +int32_t coveringZoomLevel(double z, style::SourceType type, uint16_t tileSize); std::vector<UnwrappedTileID> tileCover(const TransformState&, int32_t z); std::vector<UnwrappedTileID> tileCover(const LatLngBounds&, int32_t z); |