summaryrefslogtreecommitdiff
path: root/src/mbgl/storage
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-02-10 16:22:10 -0800
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-02-10 16:25:47 -0800
commit20be32f217b860bb0b5af3b32cea2d928b091d29 (patch)
treeca167e3dfebee2fce67046bb80781b530e8961f6 /src/mbgl/storage
parent7e287cae1b13354c202cb419c945f2883dbe0601 (diff)
downloadqtlocation-mapboxgl-20be32f217b860bb0b5af3b32cea2d928b091d29.tar.gz
[core] Always store tiles without ratio support with ratio = 1
Diffstat (limited to 'src/mbgl/storage')
-rw-r--r--src/mbgl/storage/resource.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mbgl/storage/resource.cpp b/src/mbgl/storage/resource.cpp
index 6f727a6027..d5b88d9292 100644
--- a/src/mbgl/storage/resource.cpp
+++ b/src/mbgl/storage/resource.cpp
@@ -49,6 +49,7 @@ Resource Resource::glyphs(const std::string& urlTemplate, const std::string& fon
}
Resource Resource::tile(const std::string& urlTemplate, float pixelRatio, int32_t x, int32_t y, int8_t z) {
+ bool supportsRatio = urlTemplate.find("{ratio}") != std::string::npos;
return Resource {
Resource::Kind::Tile,
util::replaceTokens(urlTemplate, [&](const std::string& token) {
@@ -71,7 +72,7 @@ Resource Resource::tile(const std::string& urlTemplate, float pixelRatio, int32_
}),
Resource::TileData {
urlTemplate,
- uint8_t(pixelRatio > 1.0 ? 2 : 1),
+ uint8_t(supportsRatio && pixelRatio > 1.0 ? 2 : 1),
x,
y,
z