From 11de777628e9e2c4b219bae3f1a6eabd86f2a3c5 Mon Sep 17 00:00:00 2001 From: Ander Conselvan de Oliveira Date: Fri, 8 Mar 2019 15:53:25 +0200 Subject: [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. v2: Document LatLngBounds::unbounded() --- src/mbgl/util/geo.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/mbgl/util/geo.cpp') 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(); -- cgit v1.2.1