flutter_map Docs
Project Links💝 Support Us
v6
v6
  • flutter_map
  • 🏗️Showcase
  • 💝Supporters
  • ✏️Credits & Contributing
  • Getting Started
    • How Does It Work?
      • Raster vs Vector Tiles
    • Demonstration
    • Installation
    • Examples
    • Migrating To v6
  • Usage
    • Base Widget
    • Options
      • Interaction Options
    • Layers
    • Programmatic Control
      • Control Camera
      • Get Camera
      • Listen To Events
    • Full API Reference
  • Layers
    • Tile Layer
      • Tile Providers
      • WMS Usage
    • Marker Layer
    • Polygon Layer
    • Polyline Layer
    • Circle Layer
    • Overlay Image Layer
    • Attribution Layer
  • Tile Servers
    • Using Mapbox
    • Using Thunderforest
    • Using Stadia Maps
    • Using Bing Maps
    • Offline Mapping
    • Other Options
  • Plugins
    • Plugins List
    • Creating A Plugin
      • Creating New Tile Providers
      • Creating New Layers
Powered by GitBook

© flutter_map Authors & Maintainers

On this page
  • Per-Layer Gesture Handling
  • Mobile vs Static Layers

Was this helpful?

Export as PDF
  1. Usage

Layers

PreviousInteraction OptionsNextProgrammatic Control

Last updated 1 year ago

Was this helpful?

To display anything on the map, you'll need to include at least one layer. This is usually a , which displays the map tiles themselves: without it, the map isn't really a very good map!

To insert a layer, add it to the children property. Other layers (sometimes referred to as 'feature layers', as they are map features) can then be stacked on top, where the last widget in the children list is topmost. For example, you might display a , or any widget as your own custom layer (Creating New Layers)!

It is possible to add more than one TileLayer! Transparency in one layer will reveal the layers underneath.

Each layer is isolated from the other layers, and so handles its own independent logic and handling. However, they can access and modify the internal state of the map, as well as respond to changes.

Per-Layer Gesture Handling

By default, each layer acts translucently to gestures, meaning they can handle gestures themselves, but they also allow gestures to bubble down to other layers beneath them.

Mobile vs Static Layers

Most layers are 'mobile', such as the TileLayer. These use a MobileLayerTransformer widget internally, which enables the layer to properly move and rotate with the map's current camera.

Both of these layer types are defined in the same children list. Most of the time, static layers go atop mobile layers, so should be at the end of the list.

To display a widget in a sized and positioned box, similar to Overlay Image Layer, try the community maintained !

This behaviour can be disabled in the , by setting .applyPointerTranslucencyToLayers false. Optionally, then, the TranslucentPointer widget can be wrapped around individal layers to achieve the desired effect.

However, some layers are 'static', such as the s. These aren't designed to move nor rotate with the map, and usually make use of a widget like Align and/or SizedBox.expand to achieve this.

flutter_map_polywidget plugin
MapOptions
AttributionLayer
TileLayer
MarkerLayer
Example FlutterMap widget, containing multiple feature layers, atop a TileLayer
Example FlutterMap widget, containing multiple feature layers, atop a TileLayer