arrow-left

All pages
gitbookPowered by GitBook
1 of 1

Loading...

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

circle-check

hashtag
Welcome to v8 ๐ŸŽ‰

Less than a half of our users are using v8 & benefiting from heaps of major new features and fixes. Consider upgrading!

  • If you're upgrading, find out

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

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

hashtag
Why choose flutter_map?

circle-info

hashtag
Vector tile support

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!

hashtag
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!

circle-exclamation

This map uses the OpenStreetMap public tile servers, which are NOT free to use by everyone.

hashtag
Get Help

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

  • Check the below, and double check the documentation

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

  • Then, for support & everything else: ask in or

circle-info

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: .

hashtag
FAQs

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

chevron-rightHow 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?hashtag

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:

chevron-rightHow can I route a user between two locations? Why does the Polyline only go in a straight line between two points?hashtag

See .

chevron-rightHow can I add a Marker where the user's location is? How can I center the map on the user's location?hashtag

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

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.

chevron-rightWhy don't any map tiles appear?hashtag

Check the debugging steps in .

chevron-rightWhy are the layers glitching on some platforms?hashtag

Check the debugging steps in .

chevron-rightWhy 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?hashtag

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).

chevron-rightHow can I make the map 3D, or view it as a globe?hashtag

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!

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

  • 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 .

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

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.

arrow-up-right arrow-up-right arrow-up-right arrow-up-right

๐Ÿ—บ๏ธ No more vendor lock-in: better flexibility, quality, and price

We natively support any static raster* 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 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:

What's New In v8.2?
Installation
v7
๐ŸŒŸShowcase & Case Studieschevron-right
vector tiles
options are available
GitHub Issuesarrow-up-right
flutter_map Discord serverarrow-up-right
GitHub Discussionsarrow-up-right
https://github.com/fleaflet/flutter_map/blob/master/CONTRIBUTING.mdarrow-up-right
https://github.com/fleaflet/flutter_map/blob/master/CODE_OF_CONDUCT.mdarrow-up-right
โ”How Does It Work?chevron-right
community maintained plugin 'flutter_map_location_marker'arrow-up-right
FAQs
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, UK
      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...
        ],
      ),
    ],
  );
}
Showcase & Case Studies
Code Demo
GitHub source
pub.dev package
Join our Discord
Support us
Platform Configuration
Platform Configuration
Routing/Navigation
Vector Tiles
flutter_map Demodemo.fleaflet.devchevron-right
Logo