summaryrefslogtreecommitdiff
path: root/src/mbgl/geometry
diff options
context:
space:
mode:
authorzmiao <miao.zhao@mapbox.com>2020-04-20 16:03:06 +0300
committerzmiao <miao.zhao@mapbox.com>2020-04-22 15:53:08 +0300
commitb4b27627d6da053574485ca2b80b395d37ebaffd (patch)
tree1c6eede0f9738c31492ac917c677682087d20e4b /src/mbgl/geometry
parent8dac8f1150910dfc62759330c7e3dcdd7e5b53a2 (diff)
downloadqtlocation-mapboxgl-b4b27627d6da053574485ca2b80b395d37ebaffd.tar.gz
[core] Distance expression: Change template class into template function in geometry_util, add range assertion for distance contaniner IndexRange
Change distance units to small letters, update tests accordingly
Diffstat (limited to 'src/mbgl/geometry')
-rw-r--r--src/mbgl/geometry/feature_index.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mbgl/geometry/feature_index.cpp b/src/mbgl/geometry/feature_index.cpp
index 85a116bc2f..afe8bb0f23 100644
--- a/src/mbgl/geometry/feature_index.cpp
+++ b/src/mbgl/geometry/feature_index.cpp
@@ -8,7 +8,7 @@
#include <mbgl/text/collision_index.hpp>
#include <mbgl/tile/tile_id.hpp>
#include <mbgl/util/constants.hpp>
-#include <mbgl/util/geometry_within.hpp>
+#include <mbgl/util/geometry_util.hpp>
#include <mbgl/util/math.hpp>
#include <mbgl/util/projection.hpp>
@@ -216,7 +216,7 @@ void DynamicFeatureIndex::query(std::unordered_map<std::string, std::vector<Feat
const mbgl::ScreenLineString& queryGeometry,
const TransformState& state) const {
if (features.empty()) return;
- mbgl::WithinBBox queryBox = DefaultBBox;
+ mbgl::GeometryBBox<int64_t> queryBox = DefaultWithinBBox;
for (const auto& p : queryGeometry) {
const LatLng c = screenCoordinateToLatLng(p, state);
const Point<double> pm = project(c, state);
@@ -225,7 +225,7 @@ void DynamicFeatureIndex::query(std::unordered_map<std::string, std::vector<Feat
}
for (const auto& f : features) {
// hit testing
- mbgl::WithinBBox featureBox = DefaultBBox;
+ mbgl::GeometryBBox<int64_t> featureBox = DefaultWithinBBox;
for (const auto& p : f.envelope->front()) mbgl::updateBBox(featureBox, p);
const bool hit = mbgl::boxWithinBox(featureBox, queryBox) || mbgl::boxWithinBox(queryBox, featureBox);