enableTouchGestures method

void enableTouchGestures(
  1. List<TouchGestures> gestures,
  2. bool enable
)

Enable or disable specific touch gestures for the map view.

Touch gestures control how users interact with the map through touch input. You can selectively enable or disable individual gesture types such as pinch-to-zoom, rotation, panning, and double-tap. This is useful for creating custom interaction modes or restricting certain gestures in specific application states.

Parameters

  • gestures: (List<TouchGestures>) List of gesture types to enable or disable.
  • enable: (bool) True to enable the specified gestures, false to disable them.

See also:

Implementation

void enableTouchGestures(
  final List<TouchGestures> gestures,
  final bool enable,
) {
  final int gesturesValue = gestures.fold(
    0,
    (final int previousValue, final TouchGestures gesture) =>
        previousValue | gesture.id,
  );
  objectMethod(
    _pointerId,
    'MapViewPreferences',
    'enableTouchGestures',
    args: <String, Object>{'gestures': gesturesValue, 'enable': enable},
    dependencyId: _mapPointerId,
  );
}