mbtiles 0.2.0 mbtiles: ^0.2.0 copied to clipboard
Mapbox MBTiles v1.3 files, support for vector and raster tiles.
mbtiles #
Mapbox MBTiles v1.3 files, support for vector and raster tiles.
- Supported raster tiles:
jpg
,png
,webp
- Supported vector tiles:
pbf
- Web is not supported because of its missing support for SQLite.
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.