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({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})

Properties

adaptiveBoundaries bool
final
bounds LatLngBounds?
getter/setter pair
boundsOptions FitBoundsOptions
getter/setter pair
center ↔ LatLng?
getter/setter pair
controller MapController?
final
crs Crs
final
debug bool
final
hashCode int
The hash code for this object.
no setterinherited
interactive bool
final
maxZoom double?
final
minZoom double?
final
nePanBoundary ↔ LatLng?
getter/setter pair
onLongPress LongPressCallback?
final
onPositionChanged PositionCallback?
final
onTap TapCallback?
final
plugins List<MapPlugin>
final
rotation double
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
screenSize Size?
final
slideOnBoundaries bool
final
swPanBoundary ↔ LatLng?
getter/setter pair
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