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? minZoom,
  18. double? maxZoom,
  19. int interactiveFlags = InteractiveFlag.all,
  20. bool allowPanning = true,
  21. TapCallback? onTap,
  22. LongPressCallback? onLongPress,
  23. PositionCallback? onPositionChanged,
  24. MapCreatedCallback? onMapCreated,
  25. List<MapPlugin> plugins = const [],
  26. bool slideOnBoundaries = false,
  27. bool adaptiveBoundaries = false,
  28. Size? screenSize,
  29. MapController? controller,
  30. LatLng? swPanBoundary,
  31. LatLng? nePanBoundary,
})

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.minZoom,
  this.maxZoom,
  this.interactiveFlags = InteractiveFlag.all,
  this.allowPanning = true,
  this.onTap,
  this.onLongPress,
  this.onPositionChanged,
  this.onMapCreated,
  this.plugins = const [],
  this.slideOnBoundaries = false,
  this.adaptiveBoundaries = false,
  this.screenSize,
  this.controller,
  this.swPanBoundary,
  this.nePanBoundary,
})  : 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.');
}