summaryrefslogtreecommitdiff
path: root/src/mbgl/text/collision_index.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/text/collision_index.cpp')
-rw-r--r--src/mbgl/text/collision_index.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mbgl/text/collision_index.cpp b/src/mbgl/text/collision_index.cpp
index b80ba215fe..1d1d1d9a10 100644
--- a/src/mbgl/text/collision_index.cpp
+++ b/src/mbgl/text/collision_index.cpp
@@ -235,7 +235,7 @@ void CollisionIndex::insertFeature(CollisionFeature& feature, bool ignorePlaceme
}
}
-std::vector<IndexedSubfeature> CollisionIndex::queryRenderedSymbols(const GeometryCoordinates& queryGeometry, const UnwrappedTileID& tileID) const {
+std::vector<IndexedSubfeature> CollisionIndex::queryRenderedSymbols(const GeometryCoordinates& queryGeometry, const UnwrappedTileID& tileID, const std::string& sourceID) const {
std::vector<IndexedSubfeature> result;
if (queryGeometry.empty() || (collisionGrid.empty() && ignoredGrid.empty())) {
return result;
@@ -271,9 +271,9 @@ std::vector<IndexedSubfeature> CollisionIndex::queryRenderedSymbols(const Geomet
std::vector<QueryResult> features = collisionGrid.query({{minX, minY}, {maxX, maxY}});
for (auto& queryResult : features) {
- auto& feature = queryResult.first;
+ auto& feature = queryResult.first;
UnwrappedTileID featureTileID(feature.z, feature.x, feature.y); // TODO: Think about overscaling/wrapping
- if (featureTileID == tileID) {
+ if (feature.sourceID == sourceID && featureTileID == tileID) {
thisTileFeatures.push_back(queryResult);
}
}
@@ -282,7 +282,7 @@ std::vector<IndexedSubfeature> CollisionIndex::queryRenderedSymbols(const Geomet
for (auto& queryResult : ignoredFeatures) {
auto& feature = queryResult.first;
UnwrappedTileID featureTileID(feature.z, feature.x, feature.y); // TODO: Think about overscaling/wrapping
- if (featureTileID == tileID) {
+ if (feature.sourceID == sourceID && featureTileID == tileID) {
thisTileFeatures.push_back(queryResult);
}
}