Expose useNativeFlingDeceleration (Mapbox Android 11.25+) as a gestureSettings prop #4233
nassimbenkirane
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
Mapbox Maps Android
11.25.0added auseNativeFlingDecelerationoption to itsGesturesPluginthat uses Android'sOverScrollerfor physics-based fling deceleration instead of the legacyeaseToanimation ("providing a more natural fling experience" — mapbox-maps-android CHANGELOG, 11.25.0-rc.1 / 11.25.0, June 2026).It would be great to expose this through
MapView'sgestureSettingsso apps can opt into the more natural fling without a native patch.Motivation
On Android, the default (legacy
easeTo) fling has noticeably weaker momentum than native maps (e.g. Google Maps) — a single pan/flick decelerates quickly and travels a short distance. iOS feels fine. The legacy fling's speed/duration/easing aren't configurable viaGesturesSettings(onlyscrollDecelerationEnabledon/off), souseNativeFlingDecelerationis the intended fix — but it's currently unreachable from JS.Proposed API
Add
useNativeFlingDeceleration?: booleanto theGestureSettingstype (documented as Android-only, no-op on iOS and on Mapbox Android < 11.25.0).Implementation notes
RNMBXMapViewManager(alongsidescrollEnabled/rotateEnabled/pitchEnabled), e.g.mapView.gestures.updateSettings { useNativeFlingDeceleration = <value> }.>= 11.25.0. rnmapbox currently pins11.20.1(package.jsonmapbox.android), so this likely depends on a default SDK bump (or users overriding viaRNMapboxMapsVersion). Guarding the setter so it's a safe no-op on older SDKs would let it land ahead of the default bump.Environment
@rnmapbox/maps: 10.3.1 (New Architecture / Fabric)Beta Was this translation helpful? Give feedback.
All reactions