Page cover image

flutter_map

Mapping package for Flutter, based off of 'leaflet.js'. Simple and easy to learn, yet completely customizable and configurable, it's the best choice for mapping in your Flutter app.

This documentation applies to v5 only!

Use the version selector in the top left to choose documentation suitable for your version.

Demonstration

Setting up an interactive and 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 just over 20 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 (
    : MapOptions(
      center: LatLng(51.509364, -0.128928),
      zoom: 9.2,
    ),
    nonRotatedChildren: [
      (
        attributions: [
          TextSourceAttribution(
            'OpenStreetMap contributors',
            onTap: () => (Uri.parse('https://openstreetmap.org/copyright')),
          ),
        ],
      ),
    ],
    : [
      TileLayer(
        : 'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
        userAgentPackageName: 'com.example.app',
      ),
    ],
  );
}

Feature Highlights

Supports any* map style

We natively support any static raster tile server, including from a web server or even from the local file system or app asset store. No more vendor lock-in!

Stress-free setup and use

Migrating from a commercial library such as Google Maps has never been easier! No more complex platform-specific setup, no more API keys: just add a widget and you're done.

Wide ecosystem of plugins

In the unlikely event that flutter_map doesn't natively contain something you need, just check to see if there's a community maintained plugin that does what you need!

Add other map features

Add polygons, polylines, and markers/pins to your map easily and quickly. Markers support displaying any widget you might want.

How does flutter_map compare to other mapping libraries?

This usually refers to libraries such as 'mapbox_gl' and 'google_maps_flutter'. In most ways, it is better, in some it is worse.

flutter_map wins on:

  • Less vendor lock-in (and potentially reduced costs) You're not locked into a particular tile server with us - choose from hundreds of options, or build your own!

  • Customizability & extensibility Add all sorts of layers to display custom widgets and data on top of your map, and choose from flutter_map's many community maintained plugins to add even more functionality!

  • Ease of use/setup We don't require any API keys or platform specific setup (other than enabling the Internet permission!), so you can get started quicker, and make changes without fear of breaking your release application.

  • Support quality and frequency Most questions are answered and resolved within 12-24 hours, thanks to our dedicated maintainers and community.

However, alternatives may win on:

  • Performance* flutter_map's performance is very adequate for the vast majority of applications, and many big businesses use FM to provide maps in their Flutter app. However, if you're using high-thousands of Markers or Polygons and such like, alternatives may win, purely because they use platform views and GL, and so can do calculations outside of Dart.

  • ... and that's pretty much it 😉

Get Help

Not quite sure about something? No problem. Please get in touch via any of these methods, and we'll be with you as soon as possible. Please remember that we are volunteers, so we cannot guarantee (fast) support.

Frequently Asked Questions

Due to time shortages and other internal matters, wait times for feature request implementations are currently extremely long and may not happen at all.

We'd love to have your contributions to add your own or others' pull requests!

Last updated

© flutter_map Authors & Maintainers