summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2016-01-18 18:43:58 +0200
committerBruno de Oliveira Abinader <bruno@mapbox.com>2016-01-19 16:06:37 +0200
commit2010fbb0e61cbe7c0b08560118ca887fc1d7193e (patch)
tree4b3c92499e47438fb7f64a046ab000037b81957c /src
parenta361ce47a19d37b96b48cd605c62c5ab79bba462 (diff)
downloadqtlocation-mapboxgl-2010fbb0e61cbe7c0b08560118ca887fc1d7193e.tar.gz
[linux] Replace PNG with WebP on tile source URL
This is a hack, in the same fashion as adding {ratio} to the tile URLs. We should update the raster tile sources to use WebP by default.
Diffstat (limited to 'src')
-rw-r--r--src/mbgl/util/mapbox.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mbgl/util/mapbox.cpp b/src/mbgl/util/mapbox.cpp
index 067c9918cc..d94a9a5f7d 100644
--- a/src/mbgl/util/mapbox.cpp
+++ b/src/mbgl/util/mapbox.cpp
@@ -129,6 +129,12 @@ std::string normalizeRasterTileURL(const std::string& url) {
}
std::string normalizedURL(url);
+#if !defined(__ANDROID__) && !defined(__APPLE__)
+ // Replace PNG with WebP.
+ if (normalizedURL.compare(extensionIdx + 1, 3, "png") == 0) {
+ normalizedURL.replace(extensionIdx + 1, 3, "webp");
+ }
+#endif // !defined(__ANDROID__) && !defined(__APPLE__)
normalizedURL.insert(extensionIdx, "{ratio}");
return normalizedURL;
}