[core] Allow tile cache size to change with viewport size

This commit is contained in:
John Firebaugh
2017-01-16 15:07:18 -08:00
committed by Bruno de Oliveira Abinader
parent 44b960fb92
commit 68440ee6c2

View File

@@ -139,7 +139,7 @@ void Source::Impl::updateTiles(const UpdateParameters& parameters) {
algorithm::updateRenderables(getTileFn, createTileFn, retainTileFn, renderTileFn,
idealTiles, zoomRange, tileZoom);
if (type != SourceType::Annotations && cache.getSize() == 0) {
if (type != SourceType::Annotations) {
size_t conservativeCacheSize =
std::max((float)parameters.transformState.getSize().width / tileSize, 1.0f) *
std::max((float)parameters.transformState.getSize().height / tileSize, 1.0f) *