summaryrefslogtreecommitdiff
path: root/src/mbgl/util/geo.cpp
diff options
context:
space:
mode:
authorAnder Conselvan de Oliveira <ander.deoliveira@mapbox.com>2019-03-08 15:53:25 +0200
committerAnder Conselvan de Oliveira <ander.deoliveira@mapbox.com>2019-03-14 18:33:11 +0200
commit11de777628e9e2c4b219bae3f1a6eabd86f2a3c5 (patch)
tree202156e7253dbc6cbb5fc5c4a04a98e8ed55e681 /src/mbgl/util/geo.cpp
parenta73cc9d8e363b0b3f4fa66c5d9c34625dffbb7e5 (diff)
downloadqtlocation-mapboxgl-11de777628e9e2c4b219bae3f1a6eabd86f2a3c5.tar.gz
[core] Remove optional from Map::setLatLngBounds()
This is a first step into grouping together bounds related Map methods into one that takes a "BoundOptions" object. LatLngBounds::unbounded() replaces an undefined optional<LatLngBounds>. v2: Document LatLngBounds::unbounded()
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();