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
  • Install
  • From pub.dev
  • From github.com
  • Additional Setup
  • Web
  • Android
  • MacOS
  • Import

Was this helpful?

Export as PDF
  1. Getting Started

Installation

PreviousRaster vs Vector TilesNextExamples

Last updated 1 year ago

Was this helpful?

Install

All users should also to work with coordinates in 'flutter_map'.

In the event that the LatLng object provided by that library conflicts with another, for example the one provided by Google Maps, you may need to .

From

Just import the package as you would normally, from the command line:

flutter pub add flutter_map latlong2
flutter pub add  # OPTIONAL

From

Commits available from Git (GitHub) may not be stable. Only use this method if you have no other choice.

If you urgently need the latest version, a specific branch, or a specific fork, you can use this method.

First, use From pub.dev, then add the following lines to your pubspec.yaml file, as a root object:

pubspec.yaml
dependency_overrides:
    flutter_map:
        git:
            url: https://github.com/fleaflet/flutter_map.git
            # ref: main (custom branch/commit)

Additional Setup

Web

Always force usage of the CanvasKit renderer instead of the HTML renderer, even on mobile devices.

The HTML renderer causes performance issues, and may also cause other bugs. Although the CanvasKit renderer does require slightly more Javascript (and therefore a longer download time), it works much better with flutter_map.

Android

flutter_map needs to access the Internet to load tiles, in most cases. On Android, apps must include the INTERNET permission in their manifest. Add the following line to all manifests:

AndroidManifest.xml
<uses-permission android:name="android.permission.INTERNET"/>

MacOS

flutter_map needs to access the Internet to load tiles, in most cases. On MacOS, apps must include a dedicated entitlement. Add the following lines to 'macos/Runner/DebugProfile.entitlements' and 'macos/Runner/Release.entitlements':

*.entitlements
<key>com.apple.security.network.client</key>
<true/>

Import

After installing the package, import it into the necessary files in your project:

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

You must comply with the appropriate restrictions and terms of service set by your tile server. Failure to do so may lead to any punishment, at the tile server's discretion.

This library and/or the creator(s) are not responsible for any violations you make using this package.

For more information about web renderers, see .

The OpenStreetMap Tile Server (as used in this documentation) ToS can be . Other servers may have different terms.

install 'latlong2'
use the 'as' suffix
pub.dev
github.com
https://docs.flutter.dev/platform-integration/web/renderers
found here