summaryrefslogtreecommitdiff
path: root/src/mbgl/util/geo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/util/geo.cpp')
-rw-r--r--src/mbgl/util/geo.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mbgl/util/geo.cpp b/src/mbgl/util/geo.cpp
index 19510e2039..1106779474 100644
--- a/src/mbgl/util/geo.cpp
+++ b/src/mbgl/util/geo.cpp
@@ -92,6 +92,10 @@ bool LatLngBounds::intersects(const LatLngBounds area, LatLng::WrapMode wrap /*=
}
LatLng LatLngBounds::constrain(const LatLng& p) const {
+ if (!bounded) {
+ return p;
+ }
+
double lat = p.latitude();
double lng = p.longitude();