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

PMTiles tile provider for vector_map_tiles (flutter_map vector tiles). It uses HTTP Range Requests to request tiles from a single local or hosted file.

flutter_map_pmtiles #

A TileProvider for flutter_map that adds support for PMTiles.

Pub Likes Pub Points Pub Popularity Pub Version

GitHub last commit GitHub issues GitHub Repo stars

Getting started #

Add the following packages to your pubspec.yaml file:

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

Usage #

  1. Initiate the TileProvider
// ...from an URL
final Future<PmTilesVectorTileProvider> _futureTileProvider = PmTilesVectorTileProvider
    .fromSource('https://example.com/useYourOwnHostedPMTilesFile.pmtiles');
// ...from an local file on the file system
final Future<PmTilesVectorTileProvider> _futureTileProvider = PmTilesVectorTileProvider
    .fromSource('some/file/system/path.pmtiles');
// ...or provide a PmTilesArchive directly 
// (you'll need to add pmtiles as direct dependency to your project)
final Future<PmTilesVectorTileProvider> _futureTileProvider = PmTilesVectorTileProvider
    .fromArchive(somePmTilesArchive);
  1. Await the response of the future, e.g. by using a FutureBuilder.

  2. Provide your PmTilesVectorTileProvider to your TileLayer

@override
Widget build(BuildContext context) {
  return FlutterMap(
    options: MapOptions(),
    children: [
      VectorTileLayer(
        theme: ProvidedThemes.lightTheme(),
        tileProviders: TileProviders({
          'openmaptiles': tileProvider,
        }),
      ),
    ],
  );
}

Additional information #

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

3
likes
0
pub points
74%
popularity

Publisher

verified publisherjoscha-eckert.de

PMTiles tile provider for vector_map_tiles (flutter_map vector tiles). It uses HTTP Range Requests to request tiles from a single local or hosted file.

Repository (GitHub)
View/report issues

Topics

#flutter-map #vector-map-tiles #map #pmtiles

License

unknown (license)

Dependencies

flutter, pmtiles, vector_map_tiles

More

Packages that depend on vector_map_tiles_pmtiles