summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAsheem Mamoowala <asheem.mamoowala@mapbox.com>2017-10-27 16:23:32 -0700
committerAsheem Mamoowala <asheem.mamoowala@mapbox.com>2017-10-30 16:44:34 -0700
commit375f9f94b6a5348ced58fa0621a8618d1c5ed075 (patch)
treea97d2b134ff010ce4c761e9d5ee027310ad2de2e /include
parent484c04a924565feade99f162826152fcf3acb8b9 (diff)
downloadqtlocation-mapboxgl-375f9f94b6a5348ced58fa0621a8618d1c5ed075.tar.gz
[core] Add LatLngBounds::contains(const LatLngBounds&)
Diffstat (limited to 'include')
-rw-r--r--include/mbgl/util/geo.hpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/mbgl/util/geo.hpp b/include/mbgl/util/geo.hpp
index 6d725b102b..54a8c99fab 100644
--- a/include/mbgl/util/geo.hpp
+++ b/include/mbgl/util/geo.hpp
@@ -161,6 +161,13 @@ public:
point.longitude() <= ne.longitude());
}
+ bool contains(const LatLngBounds& area) const {
+ return (area.ne.latitude() <= ne.latitude() &&
+ area.sw.latitude() >= sw.latitude() &&
+ area.ne.longitude() <= ne.longitude() &&
+ area.sw.longitude() >= sw.longitude());
+ }
+
bool intersects(const LatLngBounds area) const {
return (area.ne.latitude() > sw.latitude() &&
area.sw.latitude() < ne.latitude() &&