FMTC Docs
Project Links💝 Support Me
v8
v8
  • flutter_map_tile_caching
  • Is FMTC Right For Me?
  • Get Started
    • Quickstart
    • Installation
    • Additional Setup
    • Example Application
  • Usage
    • Initialisation
    • Using Roots & Stores
      • Management
      • Statistics
      • Metadata
      • Recovery
      • Migrator (v6 -> v7)
    • flutter_map Integration
    • Global Settings
    • Full API Reference
  • Bulk Downloading
    • Introduction
    • 1️⃣Create A Region
    • 2️⃣Prepare For Downloading
    • 3️⃣Start In Foreground
      • Buffering
      • 4️⃣Listen For Progress
    • 3️⃣Start In Background
      • Limitations
    • Cancel Download
  • Import & Export
    • Introduction
    • Importing
    • Exporting
  • Migration
    • v7 -> v8 Migration
    • v6 -> v7 Migration
  • Known Issues
  • Credits
  • flutter_map Docs
Powered by GitBook

© Luka Stillingfleet (JaffaKetchup)

On this page
  • 1. Install
  • 2. Initialise
  • 3. Create a store
  • 4. Connect to 'flutter_map'

Was this helpful?

Export as PDF
  1. Get Started

Quickstart

PreviousIs FMTC Right For Me?NextInstallation

Last updated 2 years ago

Was this helpful?

FMTC is licensed under GPL-v3.

If you're developing a proprietary (non open-source) application, this affects you and your application's legal right to distribution. For more information, please see .

Before using FMTC, ensure you comply with the appropriate rules and ToS set by your tile server. Failure to do so may lead to a permenant ban, or any other punishment.

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

OpenStreetMap's can be : specifically bulk downloading is discouraged, and forbidden after zoom level 13. Other servers may have different terms.

This page guides you through a simple, fast setup of FMTC that just enables basic browse caching, without any of the bells and whistles that you can discover throughout the rest of this documentation.

1.

Depend on the latest version of the package from pub.dev, then import it into the appropriate files of your project.

Console/Terminal
flutter pub add flutter_map_tile_caching
import 'package:flutter_map_tile_caching/flutter_map_tile_caching.dart';

2.

Perform the startup procedure to allow usage of FMTC's APIs and connect to the underlying systems.

main.dart
import 'package:flutter/widgets.dart';
import 'package:flutter_map_tile_caching/flutter_map_tile_caching.dart';

Future<void> main() async {
    WidgetsFlutterBinding.ensureInitialized();   
    await FlutterMapTileCaching.initialise();
    // ...
    // runApp(MyApp());
}

Create an isolated space to store tiles and other information to be accessed by the map and other methods.

main.dart
Future<void> main() async {
    WidgetsFlutterBinding.ensureInitialized();   
    await FlutterMapTileCaching.initialise();
    await FMTC.instance('mapStore').manage.createAsync();
    // ...
    // runApp(MyApp());
}

Enable your FlutterMap widget to use the caching and underlying systems of FMTC.

import 'package:flutter_map/flutter_map.dart';

TileLayer(
    urlTemplate: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
    userAgentPackageName: 'com.example.app',
    tileProvider: FMTC.instance('mapStore').getTileProvider(),
    // Other parameters as normal
),

You should now have a basic working implementation of FMTC that caches tiles for you as you browse the map!

There's a lot more to discover, from management to bulk downloading, and from statistics to exporting/importing.

3.

4.

Connect to 'flutter_map'
found here
Install
Initialise
Create a store
(Proprietary) Licensing