diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2016-01-15 12:01:37 -0800 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2016-01-18 16:54:58 -0800 |
commit | bf87eaa7b8aa049358559a96f290603e13ac736b (patch) | |
tree | c28e725d66d6cee549b72f5f3bb13fbd1f61c6ad /src/mbgl/map/transform.hpp | |
parent | c86646519a4887d47003d11061a6a82e7ff4241c (diff) | |
download | qtlocation-mapboxgl-bf87eaa7b8aa049358559a96f290603e13ac736b.tar.gz |
[core, osx] Added optional padding to convenience methods
Methods that offer a convenient way to jump or ease now accept an optional padding parameter. MGLMapView specifies the padding to ensure that keyboard-based zooming and rotation respects the toolbar.
Diffstat (limited to 'src/mbgl/map/transform.hpp')
-rw-r--r-- | src/mbgl/map/transform.hpp | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/src/mbgl/map/transform.hpp b/src/mbgl/map/transform.hpp index 77c03e939d..cb3378a532 100644 --- a/src/mbgl/map/transform.hpp +++ b/src/mbgl/map/transform.hpp @@ -46,21 +46,34 @@ public: void setLatLng(const LatLng&, const EdgeInsets&, const Duration& = Duration::zero()); void setLatLng(const LatLng&, const PrecisionPoint&, const Duration& = Duration::zero()); void setLatLngZoom(const LatLng&, double zoom, const Duration& = Duration::zero()); + void setLatLngZoom(const LatLng&, double zoom, const EdgeInsets&, const Duration& = Duration::zero()); LatLng getLatLng(const EdgeInsets& = {}) const; // Zoom /** Scales the map, keeping the given point fixed within the view. @param ds The difference in scale factors to scale the map by. - @param anchor A point relative to the top-left corner of the view. */ + @param anchor A point relative to the top-left corner of the view. + If unspecified, the center point is fixed within the view. */ void scaleBy(double ds, const PrecisionPoint& anchor = {NAN, NAN}, const Duration& = Duration::zero()); /** Sets the scale factor, keeping the given point fixed within the view. @param scale The new scale factor. - @param anchor A point relative to the top-left corner of the view. */ + @param anchor A point relative to the top-left corner of the view. + If unspecified, the center point is fixed within the view. */ void setScale(double scale, const PrecisionPoint& anchor = {NAN, NAN}, const Duration& = Duration::zero()); - /** Sets the zoom level. - @param zoom The new zoom level. */ - void setZoom(double zoom, const Duration& = Duration::zero()); + /** Sets the scale factor, keeping the center point fixed within the inset view. + @param scale The new scale factor. + @param padding The viewport padding that affects the fixed center point. */ + void setScale(double scale, const EdgeInsets& padding, const Duration& = Duration::zero()); + /** Sets the zoom level, keeping the given point fixed within the view. + @param zoom The new zoom level. + @param anchor A point relative to the top-left corner of the view. + If unspecified, the center point is fixed within the view. */ + void setZoom(double zoom, const PrecisionPoint& anchor = {NAN, NAN}, const Duration& = Duration::zero()); + /** Sets the zoom level, keeping the center point fixed within the inset view. + @param zoom The new zoom level. + @param padding The viewport padding that affects the fixed center point. */ + void setZoom(double zoom, const EdgeInsets& padding, const Duration& = Duration::zero()); /** Returns the zoom level. */ double getZoom() const; /** Returns the scale factor. */ @@ -78,6 +91,11 @@ public: counterclockwise from true north. @param anchor A point relative to the top-left corner of the view. */ void setAngle(double angle, const PrecisionPoint& anchor, const Duration& = Duration::zero()); + /** Sets the angle of rotation, keeping the center point fixed within the inset view. + @param angle The new angle of rotation, measured in radians + counterclockwise from true north. + @param padding The viewport padding that affects the fixed center point. */ + void setAngle(double angle, const EdgeInsets& padding, const Duration& = Duration::zero()); /** Returns the angle of rotation. @return The angle of rotation, measured in radians counterclockwise from true north. */ |