From c3a583cdd59c4ed8e67468caa7d2af74791c01b7 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Tue, 20 Sep 2016 07:47:42 -0700 Subject: [PATCH] [core] Allow queryRenderedFeatures prior to symbol placement (#6376) --- src/mbgl/geometry/feature_index.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/mbgl/geometry/feature_index.cpp b/src/mbgl/geometry/feature_index.cpp index 6d6521917..62db3b478 100644 --- a/src/mbgl/geometry/feature_index.cpp +++ b/src/mbgl/geometry/feature_index.cpp @@ -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 symbolFeatures = collisionTile->queryRenderedSymbols(box, scale); std::sort(symbolFeatures.begin(), symbolFeatures.end(), topDownSymbols); for (const auto& symbolFeature : symbolFeatures) {