[core] Synchronize state of CollisionIndex and FeatureIndexes.
Fixes issue #10778, in which mismatch between FeatureIndex and CollisionIndex could lead to inconsistent results or even invalid array access.
This commit is contained in:
@@ -130,7 +130,7 @@ void GeometryTile::onLayout(LayoutResult result, const uint64_t resultCorrelatio
|
||||
// replacing a tile at a different zoom that _did_ have symbols.
|
||||
(void)resultCorrelationID;
|
||||
nonSymbolBuckets = std::move(result.nonSymbolBuckets);
|
||||
featureIndex = std::move(result.featureIndex);
|
||||
pendingFeatureIndex = std::move(result.featureIndex);
|
||||
data = std::move(result.tileData);
|
||||
observer->onTileChanged(*this);
|
||||
}
|
||||
@@ -213,6 +213,12 @@ Bucket* GeometryTile::getBucket(const Layer::Impl& layer) const {
|
||||
return it->second.get();
|
||||
}
|
||||
|
||||
void GeometryTile::commitFeatureIndex() {
|
||||
if (pendingFeatureIndex) {
|
||||
featureIndex = std::move(pendingFeatureIndex);
|
||||
}
|
||||
}
|
||||
|
||||
void GeometryTile::queryRenderedFeatures(
|
||||
std::unordered_map<std::string, std::vector<Feature>>& result,
|
||||
const GeometryCoordinates& queryGeometry,
|
||||
|
||||
Reference in New Issue
Block a user