[core] When reparsing a tile, replace all existing buckets

A tile may go from having particular layers, to not having them.
(Annotation tiles in particular.)
This commit is contained in:
John Firebaugh
2015-10-29 12:01:05 -07:00
parent f6f5d9608d
commit f745f271e3
3 changed files with 4 additions and 5 deletions

View File

@@ -39,6 +39,7 @@ VectorTileData::VectorTileData(const TileID& id_,
if (!tile) {
state = State::parsed;
buckets.clear();
callback();
return;
}
@@ -69,9 +70,7 @@ VectorTileData::VectorTileData(const TileID& id_,
// Move over all buckets we received in this parse request, potentially overwriting
// existing buckets in case we got a refresh parse.
for (auto& bucket : resultBuckets.buckets) {
buckets[bucket.first] = std::move(bucket.second);
}
buckets = std::move(resultBuckets.buckets);
// The target configuration could have changed since we started placement. In this case,
// we're starting another placement run.