[core] tileSize is a source property, not a TileJSON property

This commit is contained in:
John Firebaugh
2016-01-15 11:16:00 -08:00
parent a88e58ef3a
commit 4328e6fd0d
5 changed files with 21 additions and 6 deletions

View File

@@ -43,11 +43,13 @@ namespace mbgl {
Source::Source(SourceType type_,
const std::string& id_,
const std::string& url_,
uint16_t tileSize_,
std::unique_ptr<SourceInfo>&& info_,
std::unique_ptr<mapbox::geojsonvt::GeoJSONVT>&& geojsonvt_)
: type(type_),
id(id_),
url(url_),
tileSize(tileSize_),
info(std::move(info_)),
geojsonvt(std::move(geojsonvt_)) {
}
@@ -306,7 +308,7 @@ TileData::State Source::addTile(const TileID& tileID, const StyleUpdateParameter
}
double Source::getZoom(const TransformState& state) const {
double offset = std::log(util::tileSize / info->tile_size) / std::log(2);
double offset = std::log(util::tileSize / tileSize) / std::log(2);
return state.getZoom() + offset;
}