From 20be32f217b860bb0b5af3b32cea2d928b091d29 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Wed, 10 Feb 2016 16:22:10 -0800 Subject: [core] Always store tiles without ratio support with ratio = 1 --- src/mbgl/storage/resource.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/mbgl/storage') 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 -- cgit v1.2.1