Skip to content
pubscout

vector_map_tiles_mbtiles

1.2.2, released 3 weeks ago by joscha-eckert.de

Mapbox MBTiles vector tile provider for flutter_map for offline maps

$ flutter pub add vector_map_tiles_mbtiles
Source repository

What it does

Provides a TileProvider for flutter_map that enables rendering vector tiles using MBTiles databases. It supports pbf/mvt formats for 100% offline map usage.

AI-written summary of version 1.2.2, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need fully offline vector maps in your flutter_map application
  • You are using MBTiles files containing vector tiles (pbf/mvt format)

Skip it when

  • You need web support, as SQLite support is lacking on the web
  • You are using raster tiles instead of vector tiles

Strengths

  • Enables 100% offline map rendering with vector_map_tiles and flutter_map
  • Supports gzip-encoded tile data

Weaknesses

  • Not supported on the web platform due to lack of SQLite support
  • Requires proper local file read permissions

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
2

Requires file system read permission and the MBTiles file to be accessible on the device.

final mbtiles = MbTiles(path: mbTilesPath, gzip: true);

FlutterMap(
  options: MapOptions(
    minZoom: 8,
    maxZoom: 18,
    initialZoom: 11,
  ),
  children: [
    VectorTileLayer(
      theme: _theme,
      tileProviders: TileProviders({
        'openmaptiles': MbTilesVectorTileProvider(
          mbtiles: mbtiles,
        ),
      }),
      maximumZoom: 18,
    ),
  ],
)

Alternatives

Packages that do the same job and could replace vector_map_tiles_mbtiles.

Works with

Packages commonly used together with vector_map_tiles_mbtiles: ones it builds on, ones built on it, and its own family.