summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-02-01 20:25:55 -0800
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-02-01 20:25:55 -0800
commit52689796dfed796a1e949d39be411ccca3041933 (patch)
tree4cfc320ea66acf9d0fff21b1fa64b2a4a4cf0390 /src
parent8aa3359ff00332ef17157bf3c4452e710cc10b23 (diff)
downloadqtlocation-mapboxgl-52689796dfed796a1e949d39be411ccca3041933.tar.gz
[core] Normalize only raster source tile URLs
Diffstat (limited to 'src')
-rw-r--r--src/mbgl/map/source.cpp2
-rw-r--r--src/mbgl/style/style_parser.cpp4
-rw-r--r--src/mbgl/style/style_parser.hpp2
3 files changed, 4 insertions, 4 deletions
diff --git a/src/mbgl/map/source.cpp b/src/mbgl/map/source.cpp
index b142a8471f..7f9b47440b 100644
--- a/src/mbgl/map/source.cpp
+++ b/src/mbgl/map/source.cpp
@@ -109,7 +109,7 @@ void Source::load() {
// from the stylesheet. Then merge in the values parsed from the TileJSON we retrieved
// via the URL.
try {
- newInfo = StyleParser::parseTileJSON(*res.data, url);
+ newInfo = StyleParser::parseTileJSON(*res.data, url, type);
} catch (...) {
observer->onSourceError(*this, std::current_exception());
return;
diff --git a/src/mbgl/style/style_parser.cpp b/src/mbgl/style/style_parser.cpp
index 1b088bd38f..7d53d603e5 100644
--- a/src/mbgl/style/style_parser.cpp
+++ b/src/mbgl/style/style_parser.cpp
@@ -255,7 +255,7 @@ std::unique_ptr<mapbox::geojsonvt::GeoJSONVT> StyleParser::parseGeoJSON(const JS
}
}
-std::unique_ptr<SourceInfo> StyleParser::parseTileJSON(const std::string& json, const std::string& sourceURL) {
+std::unique_ptr<SourceInfo> StyleParser::parseTileJSON(const std::string& json, const std::string& sourceURL, SourceType type) {
rapidjson::GenericDocument<rapidjson::UTF8<>, rapidjson::CrtAllocator> document;
document.Parse<0>(json.c_str());
@@ -268,7 +268,7 @@ std::unique_ptr<SourceInfo> StyleParser::parseTileJSON(const std::string& json,
std::unique_ptr<SourceInfo> result = StyleParser::parseTileJSON(document);
// TODO: Remove this hack by delivering proper URLs in the TileJSON to begin with.
- if (util::mapbox::isMapboxURL(sourceURL)) {
+ if (type == SourceType::Raster && util::mapbox::isMapboxURL(sourceURL)) {
std::transform(result->tiles.begin(),
result->tiles.end(),
result->tiles.begin(),
diff --git a/src/mbgl/style/style_parser.hpp b/src/mbgl/style/style_parser.hpp
index 3a0d0fb6b4..69bd8a3bf9 100644
--- a/src/mbgl/style/style_parser.hpp
+++ b/src/mbgl/style/style_parser.hpp
@@ -28,7 +28,7 @@ public:
std::vector<std::unique_ptr<Source>> sources;
std::vector<std::unique_ptr<StyleLayer>> layers;
- static std::unique_ptr<SourceInfo> parseTileJSON(const std::string& json, const std::string& sourceURL);
+ static std::unique_ptr<SourceInfo> parseTileJSON(const std::string& json, const std::string& sourceURL, SourceType);
static std::unique_ptr<SourceInfo> parseTileJSON(const JSValue&);
static std::unique_ptr<mapbox::geojsonvt::GeoJSONVT> parseGeoJSON(const JSValue&);