[core] Allow queryRenderedFeatures prior to symbol placement (#6376)

This commit is contained in:
John Firebaugh
2016-09-20 07:47:42 -07:00
committed by GitHub
parent a8032b5c6a
commit c3a583cdd5

View File

@@ -78,8 +78,11 @@ void FeatureIndex::query(
addFeature(result, indexedFeature, queryGeometry, filterLayerIDs, geometryTileData, tileID, style, bearing, pixelsToTileUnits);
}
// query symbol features
assert(collisionTile);
// Query symbol features, if they've been placed.
if (!collisionTile) {
return;
}
std::vector<IndexedSubfeature> symbolFeatures = collisionTile->queryRenderedSymbols(box, scale);
std::sort(symbolFeatures.begin(), symbolFeatures.end(), topDownSymbols);
for (const auto& symbolFeature : symbolFeatures) {