Other Options
Visit the Full API Reference for the full list of available options
Interactivity Settings (interactiveFlags
)
interactiveFlags
)Takes an integer bitfield, which can be treated similar to enumerables. For example:
allows/enables all interactions except for rotation (keeping the map at the heading specified by rotation
).
The flags below are available:
all
Enables all interactions
none
Disables all interactions
drag
Enables panning with one finger
pinchMove
Enables panning with two or more fingers
flingAnimation
Enables fling animation when drag
/pinchMove
have enough 'Fling Velocity'
pinchZoom
Enables zooming with a pinch gesture
doubleTapZoom
Enables zooming with a double tap (prevents onTap
from firing)
rotate
Enables rotating the map with a twist gesture
Use &
for 'AND' logic and ~
for 'NOT' logic. Combining these two gates, as shown in the example, can lead to many combinations, each easy to put together.
Defaults to enabling all interactions (all
).
Scroll Wheel Settings (enableScrollWheel
& scrollWheelVelocity
)
enableScrollWheel
& scrollWheelVelocity
)Used together to enable scroll wheel scrolling, and set it's sensitivity/speed.
The first parameter takes a bool
, enabling or disabling scroll wheel zooming. The second takes a double
, which is used as a multiplier for changing the zoom level internally.
Defaults to true
and 0.005.
When Position Changed (onPositionChanged
)
onPositionChanged
)Takes a function with two arguments. Gets called whenever the map position is changed, even if it is not changed by the user.
When Map Tapped (onTap
)
onTap
)Takes a function with one argument. Gets called whenever the the user taps/clicks/presses on the map.
When Map Ready (onMapReady
)
onMapReady
)See Usage In initState() before using this callback.
This callback can be registered if you need to do something with the map controller as soon as the map is available and initialized; generally though it isn't needed and the map is available after first build.
Takes a function with zero arguments. Gets called from the initState()
method of the FlutterMap
.
Last updated