summaryrefslogtreecommitdiff
path: root/include/mbgl/map
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2016-04-21 17:23:09 -0700
committerMinh Nguyễn <mxn@1ec5.org>2016-04-22 16:39:25 -0700
commit466ed55200ffb3a9bc5954b59d87c7dd5630e5ac (patch)
tree9daedf21439b49b82ea911883eae04ecd2ae3b79 /include/mbgl/map
parent5939dd5b412fcc1ef857711a137589aa865bd442 (diff)
downloadqtlocation-mapboxgl-466ed55200ffb3a9bc5954b59d87c7dd5630e5ac.tar.gz
[core, ios, osx] cameraThatFitsCoordinateBounds
Added an API to get a camera that you can pass into -[MGLMapView setCamera:] that fits the given coordinate bounds, by analogy with -[MKMapView regionThatFits:] or -[MKMapView mapRectThatFits:edgePadding:]. Added mbgl::Map::getCameraOptions() for getting the current camera options more conveniently.
Diffstat (limited to 'include/mbgl/map')
-rw-r--r--include/mbgl/map/map.hpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/mbgl/map/map.hpp b/include/mbgl/map/map.hpp
index e33b8e49f3..0b1720e65b 100644
--- a/include/mbgl/map/map.hpp
+++ b/include/mbgl/map/map.hpp
@@ -69,6 +69,7 @@ public:
bool isPanning() const;
// Camera
+ CameraOptions getCameraOptions(optional<EdgeInsets>) const;
void jumpTo(const CameraOptions&);
void easeTo(const CameraOptions&, const AnimationOptions&);
void flyTo(const CameraOptions&, const AnimationOptions&);
@@ -90,8 +91,8 @@ public:
double getZoom() const;
void setLatLngZoom(const LatLng&, double zoom, const Duration& = Duration::zero());
void setLatLngZoom(const LatLng&, double zoom, optional<EdgeInsets>, const Duration& = Duration::zero());
- CameraOptions cameraForLatLngBounds(const LatLngBounds&, optional<EdgeInsets>);
- CameraOptions cameraForLatLngs(const std::vector<LatLng>&, optional<EdgeInsets>);
+ CameraOptions cameraForLatLngBounds(const LatLngBounds&, optional<EdgeInsets>) const;
+ CameraOptions cameraForLatLngs(const std::vector<LatLng>&, optional<EdgeInsets>) const;
void resetZoom();
void setMinZoom(const double minZoom);
double getMinZoom() const;