flutter_map Docs
Project Links💝 Support Us
v5
v5
  • flutter_map
  • How Does It Work?
    • Raster vs Vector Tiles
  • Supporters
  • Getting Started
    • Installation
    • Quickstart
    • Examples
    • Migrating To v5
  • Usage
    • Base Widget
    • Options
    • Layers
    • Controller
    • Event Handling
    • Full API Reference
  • Layers
    • Tile Layer
      • Tile Providers
    • Marker Layer
    • Polygon Layer
    • Polyline Layer
    • Circle Layer
    • Overlay Image Layer
    • Attribution Layer
    • WMS Usage
  • Plugins
    • Plugins List
    • Making A Plugin
      • Creating New Tile Providers
      • Creating New Layers
  • Tile Servers
    • Using Mapbox
    • Using Thunderforest
    • Using Stadia Maps
    • Offline Mapping
    • Other Options
  • Frequently Asked Questions
  • Contributing
  • Credits
Powered by GitBook

© flutter_map Authors & Maintainers

On this page

Was this helpful?

Export as PDF
  1. Usage

Base Widget

PreviousMigrating To v5NextOptions

Last updated 2 years ago

Was this helpful?

FlutterMap(
    mapController: _mapController,
    options: MapOptions(),
    children: [],
    nonRotatedChildren: [],
);

Placement Recommendations

It is recommended to make the map as large as possible, to allow it to display a lot of useful information easily.

As such, we recommend using a depth-based layout (eg. using Stacks) instead of a flat-based layout (eg. using Columns). The following 3rd party packages might help with creating a modern design:

  • https://pub.dev/packages/backdrop

  • https://pub.dev/packages/sliding_up_panel

  • https://pub.dev/packages/material_floating_search_bar_2

If you must restrict the widget's size, you won't find a height or width property. Instead, use a SizedBox or Column/Row & Expanded.

The map will expand as much as possible.

To avoid errors about infinite/unspecified dimensions, ensure the map is contained within a known size widget.

options (MapOptions)

Configure options that don't directly affect the appearance of the map, such as starting location and maximum zoom limit.

mapController

Attach a controller object to control the map programatically, including panning and zooming.

children

Takes a List of Widgets (usually a dedicated 'layer') to display on the map, such as tile layers or polygon layers,

nonRotatedChildren

Similar to children, but these don't rotate or move with the other layers.