summaryrefslogtreecommitdiff
path: root/src/mbgl/style/source.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/style/source.cpp')
-rw-r--r--src/mbgl/style/source.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/mbgl/style/source.cpp b/src/mbgl/style/source.cpp
index 10959a9fd8..dcf8278c0d 100644
--- a/src/mbgl/style/source.cpp
+++ b/src/mbgl/style/source.cpp
@@ -287,6 +287,7 @@ bool Source::update(const UpdateParameters& parameters) {
};
auto createTileDataFn = [this, &parameters](const OverscaledTileID& dataTileID) -> TileData* {
if (auto data = createTile(dataTileID, parameters)) {
+ data->getTileSource()->setNecessity(TileSource::Necessity::Required);
return tileDataMap.emplace(dataTileID, std::move(data)).first->second.get();
} else {
return nullptr;
@@ -316,6 +317,7 @@ bool Source::update(const UpdateParameters& parameters) {
auto retainIt = retain.begin();
while (dataIt != tileDataMap.end()) {
if (retainIt == retain.end() || dataIt->first < *retainIt) {
+ dataIt->second->getTileSource()->setNecessity(TileSource::Necessity::Optional);
cache.add(dataIt->first, std::move(dataIt->second));
tileDataMap.erase(dataIt++);
} else {