[core] Use mapbox::geometry::{box,envelope}

This commit is contained in:
John Firebaugh
2016-05-12 11:45:12 -07:00
parent 9a7b7f6af3
commit 39da776bd7
5 changed files with 34 additions and 70 deletions

View File

@@ -153,13 +153,13 @@ Box CollisionTile::getTreeBox(const Point<float>& anchor, const CollisionBox& bo
};
}
std::vector<IndexedSubfeature> CollisionTile::queryRenderedSymbols(const float minX, const float minY, const float maxX, const float maxY, const float scale) {
std::vector<IndexedSubfeature> CollisionTile::queryRenderedSymbols(const mapbox::geometry::box<int16_t>& box, const float scale) {
std::vector<IndexedSubfeature> result;
std::unordered_map<std::string, std::set<std::size_t>> sourceLayerFeatures;
auto anchor = util::matrixMultiply(rotationMatrix, Point<float>(minX, minY));
CollisionBox queryBox(anchor, 0, 0, maxX - minX, maxY - minY, scale);
auto anchor = util::matrixMultiply(rotationMatrix, convertPoint<float>(box.min));
CollisionBox queryBox(anchor, 0, 0, box.max.x - box.min.x, box.max.y - box.min.y, scale);
auto predicates = bgi::intersects(getTreeBox(anchor, queryBox));
auto fn = [&] (const Tree& tree_) {