MapOptions constructor

MapOptions({
  1. bool allowPanningOnScrollingParent = true,
  2. Crs crs = const Epsg3857(),
  3. LatLng? center,
  4. LatLngBounds? bounds,
  5. FitBoundsOptions boundsOptions = const FitBoundsOptions(),
  6. double zoom = 13.0,
  7. double rotation = 0.0,
  8. bool debugMultiFingerGestureWinner = false,
  9. bool enableMultiFingerGestureRace = false,
  10. double rotationThreshold = 20.0,
  11. int rotationWinGestures = MultiFingerGesture.rotate,
  12. double pinchZoomThreshold = 0.5,
  13. int pinchZoomWinGestures = MultiFingerGesture.pinchZoom | MultiFingerGesture.pinchMove,
  14. double pinchMoveThreshold = 40.0,
  15. int pinchMoveWinGestures = MultiFingerGesture.pinchZoom | MultiFingerGesture.pinchMove,
  16. bool enableScrollWheel = true,
  17. double scrollWheelVelocity = 0.005,
  18. double? minZoom,
  19. double? maxZoom,
  20. int interactiveFlags = InteractiveFlag.all,
  21. bool allowPanning = true,
  22. TapCallback? onTap,
  23. LongPressCallback? onLongPress,
  24. PointerDownCallback? onPointerDown,
  25. PointerUpCallback? onPointerUp,
  26. PointerCancelCallback? onPointerCancel,
  27. PointerHoverCallback? onPointerHover,
  28. PositionCallback? onPositionChanged,
  29. MapCreatedCallback? onMapCreated,
  30. List<MapPlugin> plugins = const [],
  31. bool slideOnBoundaries = false,
  32. bool adaptiveBoundaries = false,
  33. Size? screenSize,
  34. MapController? controller,
  35. LatLng? swPanBoundary,
  36. LatLng? nePanBoundary,
  37. LatLngBounds? maxBounds,
  38. bool keepAlive = false,
})

Implementation

MapOptions({
  this.allowPanningOnScrollingParent = true,
  this.crs = const Epsg3857(),
  LatLng? center,
  this.bounds,
  this.boundsOptions = const FitBoundsOptions(),
  this.zoom = 13.0,
  this.rotation = 0.0,
  this.debugMultiFingerGestureWinner = false,
  this.enableMultiFingerGestureRace = false,
  this.rotationThreshold = 20.0,
  this.rotationWinGestures = MultiFingerGesture.rotate,
  this.pinchZoomThreshold = 0.5,
  this.pinchZoomWinGestures =
      MultiFingerGesture.pinchZoom | MultiFingerGesture.pinchMove,
  this.pinchMoveThreshold = 40.0,
  this.pinchMoveWinGestures =
      MultiFingerGesture.pinchZoom | MultiFingerGesture.pinchMove,
  this.enableScrollWheel = true,
  this.scrollWheelVelocity = 0.005,
  this.minZoom,
  this.maxZoom,
  this.interactiveFlags = InteractiveFlag.all,
  this.allowPanning = true,
  this.onTap,
  this.onLongPress,
  this.onPointerDown,
  this.onPointerUp,
  this.onPointerCancel,
  this.onPointerHover,
  this.onPositionChanged,
  this.onMapCreated,
  this.plugins = const [],
  this.slideOnBoundaries = false,
  this.adaptiveBoundaries = false,
  this.screenSize,
  this.controller,
  this.swPanBoundary,
  this.nePanBoundary,
  this.maxBounds,
  this.keepAlive = false,
})  : center = center ?? LatLng(50.5, 30.51),
      assert(rotationThreshold >= 0.0),
      assert(pinchZoomThreshold >= 0.0),
      assert(pinchMoveThreshold >= 0.0) {
  _safeAreaZoom = zoom;
  assert(slideOnBoundaries ||
      !isOutOfBounds(center)); //You cannot start outside pan boundary
  assert(!adaptiveBoundaries || screenSize != null,
      'screenSize must be set in order to enable adaptive boundaries.');
  assert(!adaptiveBoundaries || controller != null,
      'controller must be set in order to enable adaptive boundaries.');
}