MapOptions class

Annotations

Constructors

MapOptions({Crs crs = const Epsg3857(), @Deprecated('Prefer `initialCenter` instead. ' 'This option has been renamed to clarify its meaning. ' 'This option is deprecated since v6.') LatLng? center, LatLng initialCenter = const LatLng(50.5, 30.51), @Deprecated('Prefer `initialZoom` instead. ' 'This option has been renamed to clarify its meaning. ' 'This option is deprecated since v6.') double? zoom, double initialZoom = 13.0, @Deprecated('Prefer `initialRotation` instead. ' 'This option has been renamed to clarify its meaning. ' 'This option is deprecated since v6.') double? rotation, double initialRotation = 0.0, @Deprecated('Prefer `initialCameraFit` instead. ' 'This option is now part of `initalCameraFit`. ' 'This option is deprecated since v6.') LatLngBounds? bounds, @Deprecated('Prefer `initialCameraFit` instead. ' 'This option is now part of `initalCameraFit`. ' 'This option is deprecated since v6.') FitBoundsOptions boundsOptions = const FitBoundsOptions(), CameraFit? initialCameraFit, CameraConstraint? cameraConstraint, InteractionOptions? interactionOptions, @Deprecated('Prefer setting this in `interactionOptions`. ' 'This option is now part of `interactionOptions` to group all interaction related options. ' 'This option is deprecated since v6.') int? interactiveFlags, @Deprecated('Prefer setting this in `interactionOptions`. ' 'This option is now part of `interactionOptions` to group all interaction related options. ' 'This option is deprecated since v6.') bool? debugMultiFingerGestureWinner, @Deprecated('Prefer setting this in `interactionOptions`. ' 'This option is now part of `interactionOptions` to group all interaction related options. ' 'This option is deprecated since v6.') bool? enableMultiFingerGestureRace, @Deprecated('Prefer setting this in `interactionOptions`. ' 'This option is now part of `interactionOptions` to group all interaction related options. ' 'This option is deprecated since v6.') double? rotationThreshold, @Deprecated('Prefer setting this in `interactionOptions`. ' 'This option is now part of `interactionOptions` to group all interaction related options. ' 'This option is deprecated since v6.') int? rotationWinGestures, @Deprecated('Prefer setting this in `interactionOptions`. ' 'This option is now part of `interactionOptions` to group all interaction related options. ' 'This option is deprecated since v6.') double? pinchZoomThreshold, @Deprecated('Prefer setting this in `interactionOptions`. ' 'This option is now part of `interactionOptions` to group all interaction related options. ' 'This option is deprecated since v6.') int? pinchZoomWinGestures, @Deprecated('Prefer setting this in `interactionOptions`. ' 'This option is now part of `interactionOptions` to group all interaction related options. ' 'This option is deprecated since v6.') double? pinchMoveThreshold, @Deprecated('Prefer setting this in `interactionOptions`. ' 'This option is now part of `interactionOptions` to group all interaction related options. ' 'This option is deprecated since v6.') int? pinchMoveWinGestures, @Deprecated('Prefer setting this in `interactionOptions`. ' 'This option is now part of `interactionOptions` to group all interaction related options. ' 'This option is deprecated since v6.') bool? enableScrollWheel, @Deprecated('Prefer setting this in `interactionOptions`. ' 'This option is now part of `interactionOptions` to group all interaction related options. ' 'This option is deprecated since v6.') double? scrollWheelVelocity, double? minZoom, double? maxZoom, Color backgroundColor = const Color(0xFFE0E0E0), TapCallback? onTap, TapCallback? onSecondaryTap, LongPressCallback? onLongPress, PointerDownCallback? onPointerDown, PointerUpCallback? onPointerUp, PointerCancelCallback? onPointerCancel, PointerHoverCallback? onPointerHover, PositionCallback? onPositionChanged, MapEventCallback? onMapEvent, VoidCallback? onMapReady, @Deprecated('Prefer `cameraConstraint` instead. ' 'This option is now replaced by `cameraConstraint` which provides more flexibile limiting of the map position. ' 'This option is deprecated since v6.') LatLngBounds? maxBounds, bool keepAlive = false, bool applyPointerTranslucencyToLayers = true})
const

Properties

applyPointerTranslucencyToLayers bool
Whether to apply pointer translucency to all layers automatically
final
backgroundColor Color
final
bounds LatLngBounds?
final
boundsOptions FitBoundsOptions
final
cameraConstraint CameraConstraint
Note that this getter exists to make sure that the deprecated maxBounds option is consistently used. Making this a getter allows the constructor to remain const.
no setter
crs Crs
The Coordinate Reference System, defaults to Epsg3857.
final
hashCode int
The hash code for this object.
no setteroverride
initialCameraFit CameraFit?
Defines the visible bounds when the map is first loaded. Takes precedence over initialCenter/initialZoom.
final
initialCenter → LatLng
The center when the map is first loaded. If initialCameraFit is defined this has no effect.
final
initialRotation double
The rotation when the map is first loaded.
final
initialZoom double
The zoom when the map is first loaded. If initialCameraFit is defined this has no effect.
final
interactionOptions InteractionOptions
no setter
keepAlive bool
Flag to enable the built in keep alive functionality
final
maxBounds LatLngBounds?
final
maxZoom double?
final
minZoom double?
final
onLongPress LongPressCallback?
final
onMapEvent MapEventCallback?
final
onMapReady VoidCallback?
OnMapReady is called after the map runs it's initState. At that point the map has assigned its state to the controller Only use this if your map isn't built immediately (like inside FutureBuilder) and you need to access the controller as soon as the map is built. Otherwise you can use WidgetsBinding.instance.addPostFrameCallback In initState to controll the map before the next frame.
final
onPointerCancel PointerCancelCallback?
final
onPointerDown PointerDownCallback?
final
onPointerHover PointerHoverCallback?
final
onPointerUp PointerUpCallback?
final
onPositionChanged PositionCallback?
final
onSecondaryTap TapCallback?
final
onTap TapCallback?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
override

Static Methods

maybeOf(BuildContext context) MapOptions?
The options of the closest FlutterMap ancestor. If this is called from a context with no FlutterMap ancestor, null is returned.
of(BuildContext context) MapOptions
The options of the closest FlutterMap ancestor. If this is called from a context with no FlutterMap ancestor a StateError will be thrown.