mbtiles 0.1.0 copy "mbtiles: ^0.1.0" to clipboard
mbtiles: ^0.1.0 copied to clipboard

Support for Mapbox MBTiles v1.3 files

mbtiles #

A dart package that gives support for MBTiles files.

  • Supported raster tiles: jpg, png, webp
  • Supported vector tiles: pbf
  • Web is not supported because of it's lack of sqlite support

Pub Likes Pub Points Pub Popularity Pub Version

GitHub last commit GitHub issues GitHub Repo stars

Getting started #

pubspec.yaml

dependencies:
  # this package:
  mbtiles: ^0.0.1
  # sqlite libraries in case not otherwise bundled (requires flutter):
  sqlite3_flutter_libs: ^0.5.18

Usage #

// Get paths for the current platform (Windows would need "\" instead of "/"). 
// This is not needed if you use `sqlite3_flutter_libs` on Android or iOS.
final sqlitePath = 'assets/${Platform.operatingSystem}/sqlite3';

// open mbtiles
final mbtiles = MBTiles(
  mbtilesPath: 'assets/mbtiles/countries-raster.mbtiles',
  sqlitePath: sqlitePath,
);

// get metadata
final metadata = mbtiles.getMetadata();
// get tile data
final tile = mbtiles.getTile(0, 0, 0);

// close mbtiles
mbtiles.dispose();

See the example program for more information.

Additional information #