GesturesSettings

data class GesturesSettings @JvmOverloads constructor(rotateEnabled: Boolean, pinchToZoomEnabled: Boolean, scrollEnabled: Boolean, simultaneousRotateAndPinchToZoomEnabled: Boolean, pitchEnabled: Boolean, scrollMode: ScrollMode, doubleTapToZoomInEnabled: Boolean, doubleTouchToZoomOutEnabled: Boolean, quickZoomEnabled: Boolean, focalPoint: ScreenCoordinate?, pinchToZoomDecelerationEnabled: Boolean, rotateDecelerationEnabled: Boolean, scrollDecelerationEnabled: Boolean, increaseRotateThresholdWhenPinchingToZoom: Boolean, increasePinchToZoomThresholdWhenRotating: Boolean, zoomAnimationAmount: Float, pinchScrollEnabled: Boolean)

Gesture configuration allows to control the user touch interaction.

Constructors

GesturesSettings
Link copied to clipboard
fun GesturesSettings(rotateEnabled: Boolean = true, pinchToZoomEnabled: Boolean = true, scrollEnabled: Boolean = true, simultaneousRotateAndPinchToZoomEnabled: Boolean = true, pitchEnabled: Boolean = true, scrollMode: ScrollMode = ScrollMode.HORIZONTAL_AND_VERTICAL, doubleTapToZoomInEnabled: Boolean = true, doubleTouchToZoomOutEnabled: Boolean = true, quickZoomEnabled: Boolean = true, focalPoint: ScreenCoordinate? = null, pinchToZoomDecelerationEnabled: Boolean = true, rotateDecelerationEnabled: Boolean = true, scrollDecelerationEnabled: Boolean = true, increaseRotateThresholdWhenPinchingToZoom: Boolean = true, increasePinchToZoomThresholdWhenRotating: Boolean = true, zoomAnimationAmount: Float = 1f, pinchScrollEnabled: Boolean = true)

Properties

doubleTapToZoomInEnabled
Link copied to clipboard
var doubleTapToZoomInEnabled: Boolean = true

Whether double tapping the map with one touch results in a zoom-in animation.

doubleTouchToZoomOutEnabled
Link copied to clipboard
var doubleTouchToZoomOutEnabled: Boolean = true

Whether single tapping the map with two touches results in a zoom-out animation.

focalPoint
Link copied to clipboard
var focalPoint: ScreenCoordinate? = null

By default, gestures rotate and zoom around the center of the gesture. Set this property to rotate and zoom around a fixed point instead.

var increasePinchToZoomThresholdWhenRotating: Boolean = true

Whether pinch to zoom threshold increases when rotating. true by default.

var increaseRotateThresholdWhenPinchingToZoom: Boolean = true

Whether rotate threshold increases when pinching to zoom. true by default.

pinchScrollEnabled
Link copied to clipboard
var pinchScrollEnabled: Boolean = true

Whether pan is enabled for the pinch gesture.

pinchToZoomDecelerationEnabled
Link copied to clipboard
var pinchToZoomDecelerationEnabled: Boolean = true

Whether a deceleration animation following a pinch-to-zoom gesture is enabled. True by default.

pinchToZoomEnabled
Link copied to clipboard
var pinchToZoomEnabled: Boolean = true

Whether the pinch to zoom gesture is enabled.

pitchEnabled
Link copied to clipboard
var pitchEnabled: Boolean = true

Whether the pitch gesture is enabled.

quickZoomEnabled
Link copied to clipboard
var quickZoomEnabled: Boolean = true

Whether the quick zoom gesture is enabled.

rotateDecelerationEnabled
Link copied to clipboard
var rotateDecelerationEnabled: Boolean = true

Whether a deceleration animation following a rotate gesture is enabled. True by default.

rotateEnabled
Link copied to clipboard
var rotateEnabled: Boolean = true

Whether the rotate gesture is enabled.

scrollDecelerationEnabled
Link copied to clipboard
var scrollDecelerationEnabled: Boolean = true

Whether a deceleration animation following a scroll gesture is enabled. True by default.

scrollEnabled
Link copied to clipboard
var scrollEnabled: Boolean = true

Whether the single-touch scroll gesture is enabled.

scrollMode
Link copied to clipboard
var scrollMode: ScrollMode

Configures the directions in which the map is allowed to move during a scroll gesture.

simultaneousRotateAndPinchToZoomEnabled
Link copied to clipboard
var simultaneousRotateAndPinchToZoomEnabled: Boolean = true

Whether rotation is enabled for the pinch to zoom gesture.

zoomAnimationAmount
Link copied to clipboard
var zoomAnimationAmount: Float = 1f

The amount by which the zoom level increases or decreases during a double-tap-to-zoom-in or double-touch-to-zoom-out gesture. 1.0 by default. Must be positive.

Extensions

isScrollHorizontallyLimited
Link copied to clipboard
fun GesturesSettings.isScrollHorizontallyLimited(): Boolean

Returns if the scroll is horizontally limited, In other words, the scroll mode is set to vertical.

isScrollVerticallyLimited
Link copied to clipboard
fun GesturesSettings.isScrollVerticallyLimited(): Boolean

Returns if the scroll is vertically limited, In other words, the scroll mode is set to horizontal.