summaryrefslogtreecommitdiff
path: root/include/mbgl/map/map.hpp
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2015-07-30 15:34:49 -0700
committerJustin R. Miller <incanus@codesorcery.net>2015-09-07 09:22:52 -0700
commit0a172a21fdc2a87473560fd7d45f4d495d95de91 (patch)
treee4b0ccd7ee2fecdfe63ead975cbb646493ff2bb4 /include/mbgl/map/map.hpp
parent584c36f348d586bd07d27e6a4c9a7f318a98044c (diff)
downloadqtlocation-mapboxgl-0a172a21fdc2a87473560fd7d45f4d495d95de91.tar.gz
CameraOptions
Plumbed camera options all the way through to MGLMapView. Added a method that lets you specify a direction in addition to center point and zoom level. Added Map::jumpTo() for parity with mapbox-gl-js. Replaced usage of Map::setLatLng() and Map::setLatLngZoom() with Map::jumpTo() or Map::easeTo() within MGLMapView. Replaced MGLMapView.pitch with MGLMapCamera for setting all supported degrees of freedom simultaneously. Simultaneously move and rotate with course. Support customizable timing functions on iOS. iosapp now persists an archived MGLMapCamera instead of separate viewpoint properties and also synchronizes user defaults on termination. This change implements persistence entirely in Objective-C, eliminating the use of the Objective-C++ implementation. Fixes #1643, fixes #1834. Ref #1581.
Diffstat (limited to 'include/mbgl/map/map.hpp')
-rw-r--r--include/mbgl/map/map.hpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/include/mbgl/map/map.hpp b/include/mbgl/map/map.hpp
index ddf86045ee..4cd9293c9b 100644
--- a/include/mbgl/map/map.hpp
+++ b/include/mbgl/map/map.hpp
@@ -2,6 +2,7 @@
#define MBGL_MAP_MAP
#include <mbgl/util/chrono.hpp>
+#include <mbgl/map/camera.hpp>
#include <mbgl/map/update.hpp>
#include <mbgl/map/mode.hpp>
#include <mbgl/util/geo.hpp>
@@ -94,6 +95,10 @@ public:
void cancelTransitions();
void setGestureInProgress(bool);
+ // Camera
+ void jumpTo(CameraOptions options);
+ void easeTo(CameraOptions options);
+
// Position
void moveBy(double dx, double dy, const Duration& = Duration::zero());
void setLatLng(LatLng latLng, const Duration& = Duration::zero());
@@ -107,8 +112,8 @@ public:
void setZoom(double zoom, const Duration& = Duration::zero());
double getZoom() const;
void setLatLngZoom(LatLng latLng, double zoom, const Duration& = Duration::zero());
- void fitBounds(LatLngBounds bounds, EdgeInsets padding, const Duration& duration = Duration::zero());
- void fitBounds(AnnotationSegment segment, EdgeInsets padding, const Duration& duration = Duration::zero());
+ CameraOptions cameraForLatLngBounds(LatLngBounds bounds, EdgeInsets padding);
+ CameraOptions cameraForLatLngs(std::vector<LatLng> latLngs, EdgeInsets padding);
void resetZoom();
double getMinZoom() const;
double getMaxZoom() const;
@@ -121,7 +126,7 @@ public:
void resetNorth();
// Pitch
- void setPitch(double pitch);
+ void setPitch(double pitch, const Duration& = Duration::zero());
double getPitch() const;
// Size