MapOptions class Map View
Encapsulates the initial configuration required to initialize the google map view.
This class is used to specify various map settings at the time of map initialization. Example:
final settings = MapOptions(
cameraPosition: CameraPosition(
target: LatLng(37.4219999,-122.0840575),
zoom: 14.4746,
),
mapType: MapType.normal,
compassEnabled: true,
// ... other parameters
);
- Annotations
Constructors
- MapOptions({CameraPosition cameraPosition = const CameraPosition(), MapType mapType = MapType.normal, bool compassEnabled = true, bool rotateGesturesEnabled = true, bool scrollGesturesEnabled = true, bool tiltGesturesEnabled = true, bool zoomGesturesEnabled = true, bool scrollGesturesEnabledDuringRotateOrZoom = true, bool mapToolbarEnabled = true, double? minZoomPreference, double? maxZoomPreference, bool zoomControlsEnabled = true, LatLngBounds? cameraTargetBounds, EdgeInsets? padding, String? mapId, MapColorScheme mapColorScheme = MapColorScheme.followSystem})
-
Creates a new instance of MapOptions with the given initial
parameters to configure the map view.
const
Properties
- cameraPosition → CameraPosition
-
The initial positioning of the camera in the map view.
final
- cameraTargetBounds → LatLngBounds?
-
Specifies a bounds to constrain the camera target, so that when users scroll and pan the map,
the camera target does not move outside these bounds.
final
- compassEnabled → bool
-
Specifies whether the compass should be enabled.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- mapColorScheme → MapColorScheme
-
The map color scheme mode for the map view.
final
- mapId → String?
-
The map ID for cloud-based map styling.
final
- mapToolbarEnabled → bool
-
Specifies whether the mapToolbar should be enabled. Only applicable on Android.
final
- mapType → MapType
-
The type of map to display, specified using MapType enum values.
final
- maxZoomPreference → double?
-
Specifies a preferred lower bound for camera zoom.
final
- minZoomPreference → double?
-
Specifies a preferred lower bound for camera zoom.
final
- padding → EdgeInsets?
-
Specifies the initial padding for the map view.
final
- rotateGesturesEnabled → bool
-
Specifies whether rotate gestures should be enabled.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollGesturesEnabled → bool
-
Specifies whether scroll gestures should be enabled.
final
- scrollGesturesEnabledDuringRotateOrZoom → bool
-
Specifies whether scroll gestures during rotate or zoom should be enabled.
final
- tiltGesturesEnabled → bool
-
Specifies whether tilt gestures should be enabled.
final
- zoomControlsEnabled → bool
-
Specifies whether the zoom controls should be enabled. Only applicable on Android.
final
- zoomGesturesEnabled → bool
-
Specifies whether zoom gestures should be enabled.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited