summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-02-02 15:04:21 -0800
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-02-02 23:04:18 -0800
commit37c27f3a8f55ae74d7da9b5f45fa577de3af7f21 (patch)
tree88d479ad1d4a3559844c3fd8c82ab4a33c4bc55b /src
parent032c8fba3c8e3c122dd399b5c9341d92ad9d286f (diff)
downloadqtlocation-mapboxgl-37c27f3a8f55ae74d7da9b5f45fa577de3af7f21.tar.gz
[core] Improve LatLngBounds API
* Use "named constructors": empty, world, hull * Make the two-argument constructor lenient (i.e., it is a hull operation) * Add various accessors * Enforce a single empty representation
Diffstat (limited to 'src')
-rw-r--r--src/mbgl/annotation/point_annotation_impl.hpp2
-rw-r--r--src/mbgl/map/map.cpp8
2 files changed, 5 insertions, 5 deletions
diff --git a/src/mbgl/annotation/point_annotation_impl.hpp b/src/mbgl/annotation/point_annotation_impl.hpp
index 8e99856eb7..34e3fa21b0 100644
--- a/src/mbgl/annotation/point_annotation_impl.hpp
+++ b/src/mbgl/annotation/point_annotation_impl.hpp
@@ -30,7 +30,7 @@
// Make Boost Geometry aware of our LatLng type
BOOST_GEOMETRY_REGISTER_POINT_2D(mbgl::LatLng, double, boost::geometry::cs::cartesian, longitude, latitude)
-BOOST_GEOMETRY_REGISTER_BOX(mbgl::LatLngBounds, mbgl::LatLng, sw, ne)
+BOOST_GEOMETRY_REGISTER_BOX(mbgl::LatLngBounds, mbgl::LatLng, southwest(), northeast())
namespace mbgl {
diff --git a/src/mbgl/map/map.cpp b/src/mbgl/map/map.cpp
index cab1d42b38..2df86a8f1c 100644
--- a/src/mbgl/map/map.cpp
+++ b/src/mbgl/map/map.cpp
@@ -242,10 +242,10 @@ void Map::setLatLngZoom(const LatLng& latLng, double zoom, const EdgeInsets& pad
CameraOptions Map::cameraForLatLngBounds(const LatLngBounds& bounds, const EdgeInsets& padding) {
AnnotationSegment segment = {
- {bounds.ne.latitude, bounds.sw.longitude},
- bounds.sw,
- {bounds.sw.latitude, bounds.ne.longitude},
- bounds.ne,
+ bounds.northwest(),
+ bounds.southwest(),
+ bounds.southeast(),
+ bounds.northeast(),
};
return cameraForLatLngs(segment, padding);
}