flutter_map Docs
Project LinksπŸ’ Support Us
v8
v8
  • flutter_map
  • Why & How
    • 🌟Showcase & Case Studies
    • ❔How Does It Work?
      • Raster vs Vector Tiles
    • πŸ‘€Demo & Examples
  • Getting Started
    • πŸš€What's New In v8?
    • Installation
  • Usage
    • Base Widget
      • Unbounded Horizontal Scrolling
    • Options
      • Interaction Options
      • Custom CRSs
    • Layers
    • Programmatic Interaction
      • Controllers & Cameras
      • External Custom Controllers
      • Listen To Events
    • Full API Reference
  • Layers
    • Tile Layer
      • Tile Providers
      • Built-In Caching
    • Marker Layer
    • Polygon Layer
    • Polyline Layer
    • Circle Layer
    • Overlay Image Layer
    • Attribution Layer
    • Layer Interactivity
      • Hit Testing Behaviour
  • Tile Servers
    • Using OpenStreetMap (direct)
    • Using Mapbox
    • Using Google Maps
    • Using Tracestrack
    • Using Thunderforest
    • Using Stadia Maps
    • Using Lima Labs
    • Using Bing Maps
    • Offline Mapping
    • Other Options
  • Plugins
    • Plugins List
    • Creating A Plugin
      • Creating New Tile Providers
      • Creating New Layers
  • Thanks
    • πŸ’Supporters
    • ✏️Credits & Contributing
Powered by GitBook

Β© flutter_map Authors & Maintainers

On this page
  • Why choose flutter_map?
  • Code Demo
  • Get Help
  • FAQs

Was this helpful?

Edit on GitHub
Export as PDF

flutter_map

Flutter's β„–1 non-commercially aimed map client: it's easy-to-use, versatile, vendor-free, fully cross-platform, and 100% pure-Flutter

NextShowcase & Case Studies

Last updated 26 days ago

Was this helpful?

Welcome to v8 πŸŽ‰

  • If you're upgrading, find out What's New In v8?

  • If you're new here, welcome! Feel free to look around and experiment, and check out Installation when you're ready.

  • If you're looking for documentation for an older version, use the version selector. documentation is still available.

Why choose flutter_map?

Vector tile support

Code Demo

Setting up a map is simpler than making your lunch-time coffee! It can be accomplished in just under 30 lines and a minute or two to install.

This code snippet demonstrates everything you need for a simple map (in under 30 lines!), but of course, FM is capable of much more than just this, and you could find yourself lost in the many options available and possibilities opened!

import 'package:flutter_map/flutter_map.dart';
import 'package:latlong2/latlong.dart';

@override
Widget build(BuildContext context) {
  return FlutterMap(
    options: MapOptions(
      initialCenter: LatLng(51.509364, -0.128928), // Center the map over London
      initialZoom: 9.2,
    ),
    children: [
      TileLayer( // Bring your own tiles
        urlTemplate: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png', // For demonstration only
        userAgentPackageName: 'com.example.app', // Add your app identifier
        // And many more recommended properties!
      ),
      RichAttributionWidget( // Include a stylish prebuilt attribution widget that meets all requirments
        attributions: [
          TextSourceAttribution(
            'OpenStreetMap contributors',
            onTap: () => launchUrl(Uri.parse('https://openstreetmap.org/copyright')), // (external)
          ),
          // Also add images...
        ],
      ),
    ],
  );
}

This map uses the OpenStreetMap public tile servers, which are NOT free to use by everyone. A setup such as this, especially in production, would not be compliant with its requirements.

Get Help

Not quite sure about something? No worries, we're here to help!

  • Check the FAQs below, and double check the documentation

FAQs

We get quite a lot of similar questions, so please check if your question is here before you ask!

How can I use a custom map style? How can I prevent POI/labels rotating when the map rotates? How can I remove certain POI/labels from the map?

Unfortunately, this library cannot change the tiles you give it: it has no control over the tiles displayed in the TileLayer. This is a limitation of the technology, not this library.

This is because raster tiles are just images generated by a 3rd party tile server (dictated by your URL template), and therefore cannot be changed by the library that displays the tiles. Filters can be applied to the entire tile image, such as an emulated dark mode.

However, tilesets can be styled. This is the most effective way of using custom styles. These methods may help you with this:

  • You may wish to use a commercial service like Mapbox Studio, which allows you to style multiple tilesets. See Using Mapbox.

  • Your last option is to serve tiles yourself. See Other Options.

How can I route a user between two locations? Why does the Polyline only go in a straight line between two points?
How can I add a Marker where the user's location is? How can I center the map on the user's location?

Alternatively, use the 'location' and 'compass' packages to generate a stream of the user's location and heading, and feed that to a Marker using a StreamBuilder.

Why don't any map tiles appear?
Why are the layers glitching on some platforms?
Why does the map disappear/go grey when I zoom in far? Why does the map stop zooming in even though I know there are more zoom levels?

If tiles are disappearing when you zoom in, the default grey background of the FlutterMap widget will shine through. This usually means that the tile server doesn't support these higher zoom levels.

If you know that there are more tiles available further zoomed in, but flutter_map isn't showing them and scaling a particular zoom level instead, it's likely because the TileLayer.maxNativeZoom property is set too low (it defaults to 19).

To set/change the zoom level at which FM starts scaling tiles, change the TileLayer.maxNativeZoom property. To set/change the max zoom level that can actually be zoomed to (hard limit), use MapOptions.maxZoom.

How can I make the map 3D, or view it as a globe?

Unfortunately, this isn't supported, partially due to lack of time on the maintainer's part to implement this feature, partially due to technical limitations. PRs are welcome!

If you're looking for , we don't currently support them natively. We only support raster tiles at the moment.

However, , and the we and the community are actively exploring & developing future support!

Then, for bug reports & feature requests: check for previous issues, then ask in

Then, for support & everything else: ask in or

We're a community maintained project and the maintainers would greatly appreciate any help in implementing features and fixing bugs! Feel free to jump in: .

Please remember that we are volunteers and cannot guarantee support. The standard Code of Conduct is here to keep our community a safe and friendly place for everyone: .

Alternatively, you can experiment with vector tiles. These are not pre-rendered, and so allow any style you desire to be applied on the fly. See .

See .

This is beyond the scope of flutter_map. However, you can use the to do this.

Check the debugging steps in .

Check the debugging steps in .

πŸ—ΊοΈ No more vendor lock-in: better flexibility, quality, and price

We natively support any static tiles! Bring your own tiles from your own server, the user's device, a tile container, or another externally-operated tile server. Use any service, but always be free to change to get the best fit, quality, and price.

Still want to use those familiar maps? Consider great quality and better priced alternatives, or use the more mainstream Google Maps or Mapbox Maps with flutter_map.

πŸš€ Stress-free setup & easy-to-use

Migrating from a commercial library (such as Google Maps) has never been easier. No more complex platform-specific setup, no more buggy & limited platform views (we're 100% pure-Flutter), and no more lacking-documentation & support. Just setup a simple widget, grab a string from your tile server, and you're done! And, it'll work across all the platforms Flutter supports. Check out our Code Demo to see just how simple it is.

🧩 Customize and expand endlessly

Add interactive and highly customizable polygons, polylines, and markers (which support widget children) to your map easily and quickly. And because we're 100% Flutter, it's easy to add your own stuff on top without messing around in platform views. A huge community of developers maintain an ecosystem of plugins for you to supercharge flutter_map with.

πŸ‘‹ But don't just take it from us...

Hundreds of thousands of apps and users choose flutter_map for mapping in their Flutter app, making us Flutter's β„–1 non-commercially aimed map client on pub.dev. Check out some independent reviews, comparisons, and studies, and see who's using flutter_map right now: Showcase & Case Studies

🌟Showcase & Case Studies
vector tiles
GitHub Issues
flutter_map Discord server
GitHub Discussions
https://github.com/fleaflet/flutter_map/blob/master/CONTRIBUTING.md
https://github.com/fleaflet/flutter_map/blob/master/CODE_OF_CONDUCT.md
❔How Does It Work?
community maintained plugin 'flutter_map_location_marker'
v7
Platform Configuration
Platform Configuration
Routing/Navigation
Vector Tiles
options are available
flutter_map Demo
Logo
Page cover image