MapOptions constructor
MapOptions({
- Crs crs = const Epsg3857(),
- LatLng? center,
- LatLngBounds? bounds,
- FitBoundsOptions boundsOptions = const FitBoundsOptions(),
- double zoom = 13.0,
- double rotation = 0.0,
- double? minZoom,
- double? maxZoom,
- bool debug = false,
- bool interactive = true,
- TapCallback? onTap,
- LongPressCallback? onLongPress,
- PositionCallback? onPositionChanged,
- List<
MapPlugin> plugins = const [], - bool slideOnBoundaries = false,
- bool adaptiveBoundaries = false,
- Size? screenSize,
- MapController? controller,
- LatLng? swPanBoundary,
- 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 ??= const 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.');
}