diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2016-06-29 15:48:02 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-29 15:48:02 -0700 |
commit | 5389f04da5f66c5e26d71e761a0fcda4d8382581 (patch) | |
tree | 3fb0d65b0d54d31f0569b6ad4aa3b8d8b351ad61 /platform/ios/src/MGLMapView.h | |
parent | f7b646cac59e1a31157a8eebae595b613d548971 (diff) | |
download | qtlocation-mapboxgl-5389f04da5f66c5e26d71e761a0fcda4d8382581.tar.gz |
Adjustable map deceleration rate (#5504)
* [ios] Adds the ability to customize map deceleration speed
* [ios] Made pinch, rotation deceleration adjustable too
Drift zooming and drift rotation also respect the deceleration rate. A side effect of this change is that drift zooming will come to a stop ever-so-slightly sooner now.
* [ios] Documented deceleration rates
Added documentation for deceleration rate constants. Also updated the changelog.
Diffstat (limited to 'platform/ios/src/MGLMapView.h')
-rw-r--r-- | platform/ios/src/MGLMapView.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/platform/ios/src/MGLMapView.h b/platform/ios/src/MGLMapView.h index 3f649e45d2..de851bc1e5 100644 --- a/platform/ios/src/MGLMapView.h +++ b/platform/ios/src/MGLMapView.h @@ -21,6 +21,15 @@ NS_ASSUME_NONNULL_BEGIN @protocol MGLCalloutView; @protocol MGLFeature; +/** The default deceleration rate for a map view. */ +extern const CGFloat MGLMapViewDecelerationRateNormal; + +/** A fast deceleration rate for a map view. */ +extern const CGFloat MGLMapViewDecelerationRateFast; + +/** Disables decleration in a map view. */ +extern const CGFloat MGLMapViewDecelerationRateImmediate; + /** The vertical alignment of an annotation within a map view. */ typedef NS_ENUM(NSUInteger, MGLAnnotationVerticalAlignment) { /** Aligns the annotation vertically in the center of the map view. */ @@ -404,6 +413,17 @@ IB_DESIGNABLE */ @property(nonatomic, getter=isPitchEnabled) BOOL pitchEnabled; +/** + A floating-point value that determines the rate of deceleration after the user + lifts their finger. + + Your application can use the `MGLMapViewDecelerationRateNormal` and + `MGLMapViewDecelerationRateFast` constants as reference points for reasonable + deceleration rates. `MGLMapViewDecelerationRateImmediate` can be used to + disable deceleration entirely. + */ +@property(nonatomic) CGFloat decelerationRate; + #pragma mark Manipulating the Viewpoint /** |