summaryrefslogtreecommitdiff
path: root/include/mbgl/map/camera.hpp
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2015-12-19 10:22:27 -0800
committerMinh Nguyễn <mxn@1ec5.org>2015-12-19 20:48:34 -0800
commitd1d96dfe911d00332c81848b0e9e6839496515b2 (patch)
tree2c479277eee4ce43b2785fef6c70564f0efc1c6e /include/mbgl/map/camera.hpp
parent225a17d775a882b3ceaccb9d33bdc32050c1f47e (diff)
downloadqtlocation-mapboxgl-d1d96dfe911d00332c81848b0e9e6839496515b2.tar.gz
[core] Reformulated flyTo options
The speed and curve fields in CameraOptions have been replaced with velocity and minZoom fields, which expressed in screen units. Scaling and easing make it difficult to derive options that are expressed in physical units.
Diffstat (limited to 'include/mbgl/map/camera.hpp')
-rw-r--r--include/mbgl/map/camera.hpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/include/mbgl/map/camera.hpp b/include/mbgl/map/camera.hpp
index 626ccac353..73d7d5e7d2 100644
--- a/include/mbgl/map/camera.hpp
+++ b/include/mbgl/map/camera.hpp
@@ -38,15 +38,16 @@ struct CameraOptions {
/** Time to animate to the viewpoint defined herein. */
mapbox::util::optional<Duration> duration;
- /** Average velocity of a flyTo() transition, measured in distance units per
- second. */
- mapbox::util::optional<double> speed;
+ /** Average velocity of a flyTo() transition, measured in screenfuls per
+ second, assuming a linear timing curve.
+
+ A <i>screenful</i> is the visible span in pixels. It does not correspond
+ to a fixed physical distance but rather varies by zoom level. */
+ mapbox::util::optional<double> velocity;
- /** The relative amount of zooming that takes place along the flight path of
- a flyTo() transition. A high value maximizes zooming for an exaggerated
- animation, while a low value minimizes zooming for something closer to
- easeTo(). */
- mapbox::util::optional<double> curve;
+ /** Zero-based zoom level at the peak of the flyTo() transition’s flight
+ path. */
+ mapbox::util::optional<double> minZoom;
/** The easing timing curve of the transition. */
mapbox::util::optional<mbgl::util::UnitBezier> easing;