VectorMB Tiles is a Flutter plugin for working with Mapbox Vector Tiles in FlutterMap.
By extending VectorTileProvider and specifying VectorMBTiles as the argument of MemoryCacheVectorTileProvider to delegate, it can operate at high speed in memory.
Add the package with the following command
flutter pub add vector_mbtiles
refer to the following. See /example
folder for details
VectorTileLayerWidget(
options: VectorTileLayerOptions(
theme: Theme,
tileProviders: TileProviders({
'openmaptiles': VectorMBTilesProvider(
mbtilesPath: '/path/to/mbtiles',
maximumZoom: 18)
})
),
)
Added support of reading uncompressed tiles from database. This could speed up loading of tiles on low power devices.
To use this option supply TileCompression.none
to the constructor of VectorMBTilesProvider
class
VectorMBTilesProvider(
mbtilesPath: _basemapPath(),
// this is the maximum zoom of the provider, not the
// maximum of the map. vector tiles are rendered
// to larger sizes to support higher zoom levels
maximumZoom: 15,
// option to use map with uncompressed tiles
tileCompression: TileCompression.none)
Added sqflite_common_ffi package to enable work on Linux and Windows.