MapOptions constructor

MapOptions({
  1. Crs crs = const Epsg3857(),
  2. LatLng? center,
  3. LatLngBounds? bounds,
  4. FitBoundsOptions boundsOptions = const FitBoundsOptions(),
  5. double zoom = 13.0,
  6. double rotation = 0.0,
  7. double? minZoom,
  8. double? maxZoom,
  9. bool debug = false,
  10. bool interactive = true,
  11. TapCallback? onTap,
  12. LongPressCallback? onLongPress,
  13. PositionCallback? onPositionChanged,
  14. List<MapPlugin> plugins = const [],
  15. bool slideOnBoundaries = false,
  16. bool adaptiveBoundaries = false,
  17. Size? screenSize,
  18. MapController? controller,
  19. LatLng? swPanBoundary,
  20. LatLng? nePanBoundary,
})

Implementation

MapOptions({
  this.crs = const Epsg3857(),
  this.center,
  this.bounds,
  this.boundsOptions = const FitBoundsOptions(),
  this.zoom = 13.0,
  this.rotation = 0.0,
  this.minZoom,
  this.maxZoom,
  this.debug = false,
  this.interactive = true,
  this.onTap,
  this.onLongPress,
  this.onPositionChanged,
  this.plugins = const [],
  this.slideOnBoundaries = false,
  this.adaptiveBoundaries = false,
  this.screenSize,
  this.controller,
  this.swPanBoundary,
  this.nePanBoundary,
}) {
  center ??= LatLng(50.5, 30.51);
  _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.');
}