MapOptions class

Allows you to provide your map's starting properties for zoom, rotation and center. Alternatively you can provide bounds instead of center. If both, center and bounds are provided, bounds will take preference over center. Zoom, pan boundary and interactivity constraints can be specified here too.

Callbacks for onTap, onLongPress and onPositionChanged can be registered here.

Through crs the Coordinate Reference System can be defined, it defaults to Epsg3857.

Checks if a coordinate is outside of the map's defined boundaries.

If you download offline tiles dynamically, you can set adaptiveBoundaries to true (make sure to pass screenSize and an external controller), which will enforce panning/zooming to ensure there is never a need to display tiles outside the boundaries set by swPanBoundary and nePanBoundary.

Constructors

MapOptions({bool allowPanningOnScrollingParent = true, Crs crs = const Epsg3857(), LatLng? center, LatLngBounds? bounds, FitBoundsOptions boundsOptions = const FitBoundsOptions(), double zoom = 13.0, double rotation = 0.0, bool debugMultiFingerGestureWinner = false, bool enableMultiFingerGestureRace = false, double rotationThreshold = 20.0, int rotationWinGestures = MultiFingerGesture.rotate, double pinchZoomThreshold = 0.5, int pinchZoomWinGestures = MultiFingerGesture.pinchZoom | MultiFingerGesture.pinchMove, double pinchMoveThreshold = 40.0, int pinchMoveWinGestures = MultiFingerGesture.pinchZoom | MultiFingerGesture.pinchMove, bool enableScrollWheel = true, double? minZoom, double? maxZoom, int interactiveFlags = InteractiveFlag.all, bool allowPanning = true, TapCallback? onTap, LongPressCallback? onLongPress, PositionCallback? onPositionChanged, MapCreatedCallback? onMapCreated, List<MapPlugin> plugins = const [], bool slideOnBoundaries = false, bool adaptiveBoundaries = false, Size? screenSize, MapController? controller, LatLng? swPanBoundary, LatLng? nePanBoundary})

Properties

adaptiveBoundaries bool
final
allowPanning bool
final
allowPanningOnScrollingParent bool
final
bounds LatLngBounds?
final
boundsOptions FitBoundsOptions
final
center → LatLng
final
controller MapController?
final
crs Crs
final
debugMultiFingerGestureWinner bool
Prints multi finger gesture winner Helps to fine adjust rotationThreshold and pinchZoomThreshold and pinchMoveThreshold Note: only takes effect if enableMultiFingerGestureRace is true
final
enableMultiFingerGestureRace bool
If true then rotationThreshold and pinchZoomThreshold and pinchMoveThreshold will race If multiple gestures win at the same time then precedence: pinchZoomWinGestures > rotationWinGestures > pinchMoveWinGestures
final
enableScrollWheel bool
If true then the map will scroll when the user uses the scroll wheel on his mouse. This is supported on web and desktop, but might also work well on Android. A Listener is used to capture the onPointerSignal events.
final
hashCode int
The hash code for this object.
no setterinherited
interactiveFlags int
see InteractiveFlag for custom settings
final
maxZoom double?
final
minZoom double?
final
nePanBoundary → LatLng?
final
onLongPress LongPressCallback?
final
onMapCreated MapCreatedCallback?
final
onPositionChanged PositionCallback?
final
onTap TapCallback?
final
pinchMoveThreshold double
Pinch Move threshold default is 40.0 (note: this doesn't take any effect on drag) Map starts to move when pinchMoveThreshold has been achieved or another multi finger gesture wins which allows MultiFingerGesture.pinchMove Note: if interactiveFlags doesn't contain InteractiveFlag.pinchMove or enableMultiFingerGestureRace is false then pinch move cannot win
final
pinchMoveWinGestures int
When pinchMoveThreshold wins over rotationThreshold and pinchZoomThreshold then pinchMoveWinGestures gestures will be used. By default MultiFingerGesture.pinchMove and MultiFingerGesture.pinchZoom gestures will take effect see MultiFingerGesture for custom settings
final
pinchZoomThreshold double
Pinch Zoom threshold default is 0.5 Map starts to zoom when pinchZoomThreshold has been achieved or another multi finger gesture wins which allows MultiFingerGesture.pinchZoom Note: if interactiveFlags doesn't contain InteractiveFlag.pinchZoom or enableMultiFingerGestureRace is false then zoom cannot win
final
pinchZoomWinGestures int
When pinchZoomThreshold wins over rotationThreshold and pinchMoveThreshold then pinchZoomWinGestures gestures will be used. By default MultiFingerGesture.pinchZoom and MultiFingerGesture.pinchMove gestures will take effect see MultiFingerGesture for custom settings
final
plugins List<MapPlugin>
final
rotation double
final
rotationThreshold double
Rotation threshold in degree default is 20.0 Map starts to rotate when rotationThreshold has been achieved or another multi finger gesture wins which allows MultiFingerGesture.rotate Note: if interactiveFlags doesn't contain InteractiveFlag.rotate or enableMultiFingerGestureRace is false then rotate cannot win
final
rotationWinGestures int
When rotationThreshold wins over pinchZoomThreshold and pinchMoveThreshold then rotationWinGestures gestures will be used. By default only MultiFingerGesture.rotate gesture will take effect see MultiFingerGesture for custom settings
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
screenSize Size?
final
slideOnBoundaries bool
final
swPanBoundary → LatLng?
final
zoom double
final

Methods

containPoint(LatLng point, LatLng fallback) → LatLng
isOutOfBounds(LatLng? center) bool
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.
inherited