[core] move raster tile URL normalization to source parsing

This commit is contained in:
Konstantin Käfer
2016-01-13 11:50:48 +01:00
committed by John Firebaugh
parent 1ff317c1cd
commit 62973f9e5a
4 changed files with 19 additions and 19 deletions

View File

@@ -174,6 +174,14 @@ void Source::load() {
if (info.type == SourceType::Vector || info.type == SourceType::Raster) {
parseTileJSON(d);
// TODO: Remove this hack by delivering proper URLs in the TileJSON to begin with.
if (info.type == SourceType::Raster && util::mapbox::isMapboxURL(info.url)) {
// We need to insert {ratio} into raster source URLs that are loaded from mapbox://
// TileJSONs.
std::transform(info.tiles.begin(), info.tiles.end(), info.tiles.begin(),
util::mapbox::normalizeRasterTileURL);
}
} else if (info.type == SourceType::GeoJSON) {
parseGeoJSON(d);
}