summaryrefslogtreecommitdiff
path: root/src/mbgl/text
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/text')
-rw-r--r--src/mbgl/text/collision_index.cpp8
-rw-r--r--src/mbgl/text/collision_index.hpp2
2 files changed, 5 insertions, 5 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);
}
}
diff --git a/src/mbgl/text/collision_index.hpp b/src/mbgl/text/collision_index.hpp
index 0d19d6f9cd..3a6ad031af 100644
--- a/src/mbgl/text/collision_index.hpp
+++ b/src/mbgl/text/collision_index.hpp
@@ -31,7 +31,7 @@ public:
void insertFeature(CollisionFeature& feature, bool ignorePlacement);
- std::vector<IndexedSubfeature> queryRenderedSymbols(const GeometryCoordinates&, const UnwrappedTileID& tileID) const;
+ std::vector<IndexedSubfeature> queryRenderedSymbols(const GeometryCoordinates&, const UnwrappedTileID& tileID, const std::string& sourceID) const;
private: