flutter_map_mbtiles 1.0.1 copy "flutter_map_mbtiles: ^1.0.1" to clipboard
flutter_map_mbtiles: ^1.0.1 copied to clipboard

Mapbox MBTiles tile provider for flutter_map that can be used for a map that is 100% offline.

flutter_map_mbtiles #

Raster and Vector MBTiles TileProvider for flutter_map.

  • Supported raster tiles: jpg, png, webp
  • If you want to use pbf vector tiles you can use vector_map_tiles_mbtiles.
  • Web is not supported because of it's lacking SQLite support.

Pub Version likes Pub Points Pub Popularity

GitHub last commit stars GitHub issues codecov

Getting started #

pubspec.yaml

dependencies:
  flutter_map: ^6.0.0         # in case you don't have it yet 
  flutter_map_mbtiles: ^1.0.0 # this package

Usage #

// provide the path of the MBTiles file to the tile provider.
// The file must be on your file system and the app must have the permission 
// to access to it. The file can't be in your assets.
final _futureTileProvider = MbTilesTileProvider
    .fromSource('path/to/file.mbtiles');

@override
Widget build(BuildContext context) {
  return FlutterMap(
    options: MapOptions(),
    children: [
      TileLayer(
        // use your awaited MbTilesTileProvider
        tileProvider: tileProvider,
      ),
    ],
  );
}

@override
void dispose() {
// close mbtiles database
  tileProvider.dispose();
  super.dispose();
}

Additional information #

If you need help you can open an issue or join the flutter_map discord server.

2
likes
130
pub points
75%
popularity

Publisher

verified publisherjoscha-eckert.de

Mapbox MBTiles tile provider for flutter_map that can be used for a map that is 100% offline.

Repository (GitHub)
View/report issues

Topics

#flutter-map #mbtiles #map

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter, flutter_map, mbtiles, sqlite3_flutter_libs

More

Packages that depend on flutter_map_mbtiles